Skip to content

Hiding Pages

Hidden pages

Hidden pages are still built and accessible by going to their url. Use the exclude_docs option from MkDocs to completely exclude files.

Hiding a Directory

Hide a directory and all its children from the navigation:

.nav.yml
hide: true
File Structure
docs/
├─ getting-started.md
└─ api/
   ├─ .nav.yml
   ├─ apps.md
   └─ users.md
  • Getting started

Ignore Patterns

Hide directories and pages using .gitignore-style glob patterns:

.nav.yml
ignore: "*.hidden.md"
File Structure
docs/
├─ getting-started.md
└─ faq.hidden.md
  • Getting started
Patterns that start with * need to be wrapped in quotes

YAML uses * at the beginning of nodes for aliases. Make sure to wrap your pattern in quotes if it starts with *.

Without the quotes, you get the following error:

ERROR   -  awesome-nav: Parsing error [.nav.yml]
           while scanning an alias
             in "<unicode string>", line 4, column 5:
                 - *
                   ^
           expected alphabetic or numeric character, but found '\x00'
             in "<unicode string>", line 4, column 6:
                 - *
                    ^

Make it a list if you have multiple patterns:

.nav.yml
ignore:
  - "*.hidden.md"
  - hidden/
Child directories inherit this setting

ignore applies to all child directories as well, unless it's overridden by a .nav.yml there.

If you want to keep the inherited ignore patterns and extend them with additional ones, use the special $inherit value:

.nav.yml
ignore:
  - $inherit
  - "*.hidden.md"

Take a look at the glob patterns section of the nav documentation for some more examples of patterns.

Tip

The not_in_nav option from MkDocs provides a similar feature. awesome-nav is fully compatible and will take not_in_nav into account.