feat: add option to hide nav title (#637) (#677)

close #637 

Co-authored-by: Kia Ishii <kia.king.08@gmail.com>
pull/686/head
Percy Ma 3 years ago committed by GitHub
parent 1db3730a48
commit 5f0d9153a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,6 +33,20 @@ export default {
}
```
## siteTitle
- Type: `string | false`
You can customize this item to replace the default site title (`title` in app config) in nav. When set to `false`, title in nav will be disabled. Useful when you have `logo` that already contains the site title text.
```ts
export default {
themeConfig: {
siteTitle: 'Hello World'
}
}
```
## footer
- Type: `Footer`

@ -9,8 +9,9 @@ const { hasSidebar } = useSidebar()
<template>
<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 }}
<img v-if="theme.logo" class="logo" :src="theme.logo">
<template v-if="theme.siteTitle">{{ theme.siteTitle }}</template>
<template v-else-if="theme.siteTitle === undefined">{{ site.title }}</template>
</a>
</div>
</template>

@ -7,6 +7,12 @@ export namespace DefaultTheme {
*/
logo?: string
/**
* Custom site title in navbar. If the value is undefined,
* `config.title` will be used.
*/
siteTitle?: string | false
/**
* The nav items.
*/

Loading…
Cancel
Save