Skip to content

Commit 504268c

Browse files
patzickulivz
authored andcommitted
feat: support disable navbar via front matter (close: #187) (#232)
1 parent b4a4ae3 commit 504268c

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

docs/default-theme-config/README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ Any additional content after the `YAML front matter` will be parsed as normal ma
3333

3434
If you want to use a completely custom homepage layout, you can also use a [Custom Layout](#custom-layout-for-specific-pages).
3535

36-
## Navbar Links
36+
## Navbar
37+
38+
The Navbar may contain your page title, [Search Box](#search-box), [Navbar Links](#navbar-links), [Languages](/guide/i18n.html#internationalization) and [Repository link](/default-theme-config/#git-repo-and-edit-links) - all of them depends on your configuration.
39+
40+
### Navbar Links
3741

3842
You can add links to the navbar via `themeConfig.nav`:
3943

@@ -86,6 +90,16 @@ module.exports = {
8690
}
8791
```
8892

93+
### Disable the Navbar
94+
95+
You can disable the navbar for a specific page via `YAML front matter`:
96+
97+
``` yaml
98+
---
99+
navbar: false
100+
---
101+
```
102+
89103
## Sidebar
90104

91105
To enable the sidebar, use `themeConfig.sidebar`. The basic configuration expects an Array of links:

lib/default-theme/Layout.vue

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export default {
4141
computed: {
4242
shouldShowNavbar () {
4343
const { themeConfig } = this.$site
44+
const { frontmatter } = this.$page
45+
if (frontmatter.navbar === false) return false
4446
return (
4547
this.$title ||
4648
themeConfig.logo ||

0 commit comments

Comments
 (0)