feat: option to hide title in case of logo

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

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

@ -7,6 +7,11 @@ export namespace DefaultTheme {
*/ */
logo?: string logo?: string
/**
* Hide title when logo is avaiable
*/
hideTitle?: boolean
/** /**
* The nav items. * The nav items.
*/ */

Loading…
Cancel
Save