feat: option to hide title in case of logo

close https://github.com/vuejs/vitepress/issues/637
pull/677/head
Percy Ma 3 years ago
parent c219c0f1dd
commit 09b9ba2d10
No known key found for this signature in database
GPG Key ID: A1803D3315E6CCBC

@ -10,8 +10,10 @@ const { hasSidebar } = useSidebar()
<div class="VPNavBarTitle" :class="{ 'has-sidebar': hasSidebar }">
<a class="title" href="/">
<img v-if="theme.logo" class="logo" :src="theme.logo" :alt="site.title">
{{ site.title }}
<template v-if="theme.siteTitle">{{ theme.siteTitle }}</template>
<template v-else-if="theme.siteTitle || !theme.logo">{{ site.title }}</template>
</a>
</div>
</template>

@ -7,6 +7,11 @@ export namespace DefaultTheme {
*/
logo?: string
/**
* Custom site title in navbar
*/
siteTitle?: string | false
/**
* The nav items.
*/

Loading…
Cancel
Save