Skip to content

Commit e725ad2

Browse files
patzickulivz
authored andcommitted
feat: support disable navbar globally (#246)
1 parent 1417a35 commit e725ad2

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

docs/default-theme-config/README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you want to use a completely custom homepage layout, you can also use a [Cust
3535

3636
## Navbar
3737

38-
The Navbar may contain yourg page title, [Search Box](#search-box), [Navbar Links](#navbar-links), [Languages](../guide/i18n.md) and [Repository Link](#git-repo-and-edit-links), all of them depends on your configuration.
38+
The Navbar may contain your page title, [Search Box](#search-box), [Navbar Links](#navbar-links), [Languages](../guide/i18n.md) and [Repository Link](#git-repo-and-edit-links), all of them depends on your configuration.
3939

4040
### Navbar Links
4141

@@ -92,6 +92,17 @@ module.exports = {
9292

9393
### Disable the Navbar
9494

95+
To disable the navbar globally, use `themeConfig.navbar`.
96+
97+
``` js
98+
// .vuepress/config.js
99+
module.exports = {
100+
themeConfig: {
101+
navbar: false
102+
}
103+
}
104+
```
105+
95106
You can disable the navbar for a specific page via `YAML front matter`:
96107

97108
``` yaml

lib/default-theme/Layout.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ export default {
4242
shouldShowNavbar () {
4343
const { themeConfig } = this.$site
4444
const { frontmatter } = this.$page
45-
if (frontmatter.navbar === false) return false
45+
if (
46+
frontmatter.navbar === false ||
47+
themeConfig.navbar === false) {
48+
return false
49+
}
4650
return (
4751
this.$title ||
4852
themeConfig.logo ||

0 commit comments

Comments
 (0)