提交 504268c7 编写于 作者: P patzick 提交者: ULIVZ

feat: support disable navbar via front matter (close: #187) (#232)

上级 b4a4ae3f
...@@ -33,7 +33,11 @@ Any additional content after the `YAML front matter` will be parsed as normal ma ...@@ -33,7 +33,11 @@ Any additional content after the `YAML front matter` will be parsed as normal ma
If you want to use a completely custom homepage layout, you can also use a [Custom Layout](#custom-layout-for-specific-pages). If you want to use a completely custom homepage layout, you can also use a [Custom Layout](#custom-layout-for-specific-pages).
## Navbar Links ## Navbar
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.
### Navbar Links
You can add links to the navbar via `themeConfig.nav`: You can add links to the navbar via `themeConfig.nav`:
...@@ -86,6 +90,16 @@ module.exports = { ...@@ -86,6 +90,16 @@ module.exports = {
} }
``` ```
### Disable the Navbar
You can disable the navbar for a specific page via `YAML front matter`:
``` yaml
---
navbar: false
---
```
## Sidebar ## Sidebar
To enable the sidebar, use `themeConfig.sidebar`. The basic configuration expects an Array of links: To enable the sidebar, use `themeConfig.sidebar`. The basic configuration expects an Array of links:
......
...@@ -41,6 +41,8 @@ export default { ...@@ -41,6 +41,8 @@ export default {
computed: { computed: {
shouldShowNavbar () { shouldShowNavbar () {
const { themeConfig } = this.$site const { themeConfig } = this.$site
const { frontmatter } = this.$page
if (frontmatter.navbar === false) return false
return ( return (
this.$title || this.$title ||
themeConfig.logo || themeConfig.logo ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册