Navigation
nav.yaml decides what the sidebar shows and what order it is in.
Navigation
Section titled “Navigation”nav.yaml is the one file that decides your sidebar. Ordering does not come from
file names or from frontmatter; it comes from here.
The shape
Section titled “The shape”space: Stalelessdescription: Documentation that cannot go stale without saying so.
sections: - label: Start here icon: 🚀 items: - page: index - page: start/quickstart - label: Guides icon: 📘 items: - page: guides/deploy items: - page: guides/rollback - separator: true label: Reference - label: Status href: https://status.example.comTop level
Section titled “Top level”spacestringThe project name, shown in the header.
descriptionstringOne sentence. It becomes the site’s meta description.
spacesarrayA switcher, when a company publishes more than one site. Each entry takes
label, href, and current: true on the site being served.
sectionsarrayrequiredThe sidebar groups, in order.
A section
Section titled “A section”labelstringrequiredThe group heading.
iconstringOne emoji, shown before the label.
itemsarrayrequiredWhat the group contains.
The four kinds of item
Section titled “The four kinds of item”A page. page: is the path under pages/, without the extension.
- page: guides/installA nested page. Add items: to a page to nest children under it.
- page: guides/deploy items: - page: guides/rollbackAn external link. href must begin with https://, http://, mailto: or
tel:.
- label: Status href: https://status.example.comA separator. A rule between items, with an optional label above it.
- separator: true label: ReferenceEvery page must be listed
Section titled “Every page must be listed”A page under pages/ that no section names is an orphan, and the orphan
rule is an error. The commit is refused.
This is deliberate. A page nothing links to is a page nobody reads, and the common cause is a file somebody forgot to finish.
Tip
To publish a page that should not appear in the sidebar, list it in nav.yaml
and set noindex: true, or keep it as a draft. Do not leave it unlisted.
Moving a page
Section titled “Moving a page”A move is three changes in one branch:
- the file, to its new path;
nav.yaml, to the new path;redirects.yaml, so the old URL still works.
docs_move over MCP does the first. The linter catches the other two:
nav-missing-page if the navigation still points at the old path, and
redirect-conflict if a published URL was left with nothing behind it.
Rules the navigation must pass
Section titled “Rules the navigation must pass”| Rule | Severity | What it means |
|---|---|---|
nav-invalid | error | The YAML does not match the schema. |
nav-missing-page | error | A section names a page that does not exist. |
nav-duplicate | error | The same page is listed twice. |
orphan | error | A page exists that no section lists. |
Nesting is supported. Two levels is usually enough, and three is a sign the section should be split. The sidebar will render what you write; the reader has to hold it in their head.