提交 e725ad2b 编写于 作者: P patzick 提交者: ULIVZ

feat: support disable navbar globally (#246)

上级 1417a355
......@@ -35,7 +35,7 @@ If you want to use a completely custom homepage layout, you can also use a [Cust
## Navbar
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.
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.
### Navbar Links
......@@ -92,6 +92,17 @@ module.exports = {
### Disable the Navbar
To disable the navbar globally, use `themeConfig.navbar`.
``` js
// .vuepress/config.js
module.exports = {
themeConfig: {
navbar: false
}
}
```
You can disable the navbar for a specific page via `YAML front matter`:
``` yaml
......
......@@ -42,7 +42,11 @@ export default {
shouldShowNavbar () {
const { themeConfig } = this.$site
const { frontmatter } = this.$page
if (frontmatter.navbar === false) return false
if (
frontmatter.navbar === false ||
themeConfig.navbar === false) {
return false
}
return (
this.$title ||
themeConfig.logo ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册