diff --git a/docs/default-theme-config/README.md b/docs/default-theme-config/README.md index 3860d42a6b..7f88dba0c4 100644 --- a/docs/default-theme-config/README.md +++ b/docs/default-theme-config/README.md @@ -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 diff --git a/lib/default-theme/Layout.vue b/lib/default-theme/Layout.vue index bcb6436daa..2415059bc6 100644 --- a/lib/default-theme/Layout.vue +++ b/lib/default-theme/Layout.vue @@ -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 ||