Skip to content

Commit

Permalink
feat: support disable navbar globally (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
patzick authored and ulivz committed Apr 25, 2018
1 parent 1417a35 commit e725ad2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 12 additions & 1 deletion docs/default-theme-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion lib/default-theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit e725ad2

Please sign in to comment.