Side Navigation
Configure the sidebar links that help readers move through your documentation.
The side navigation is the list of links shown beside normal documentation pages.
You already used it in Navigation Basics. This page goes one step deeper and shows how to organize the sidebar as your documentation grows.
Open the side navigation file
The side navigation lives here:
config/navigation/sidenav.yamlThe starter project uses a small example:
- label: The Ring
expanded: true
children:
- label: Lore of the Ring
path: /lore
- label: Wielding the Ring
path: /wielding-the-ring
- label: Safeguards
path: /safeguardsThis file is written in YAML. Spaces matter, so keep the indentation lined up.
Add a simple link
A sidebar link needs a label and a path:
- label: Installation
path: /installationThe label is what readers see.
The path is the route the link opens. Use the browser route, not the .md file path.
Group related links
Most documentation sites use groups:
- label: Getting Started
children:
- label: Installation
path: /getting-started/installation
- label: First Project
path: /getting-started/first-projectThe group label helps readers understand what the links have in common.
Use groups when you have several pages that belong together.
Link the group label
A group can also link to a page.
This is useful when the group has an overview page and several detail pages:
- label: Getting Started
path: /getting-started
children:
- label: Installation
path: /getting-started/installation
- label: First Project
path: /getting-started/first-projectIn this example, clicking Getting Started opens /getting-started.
The child links still appear under the group.
Open a group by default
Add expanded: true when you want a group to start open:
- label: Getting Started
expanded: true
children:
- label: Installation
path: /getting-started/installation
- label: First Project
path: /getting-started/first-projectThis is helpful for the first section readers are likely to use or you do not have many pages and you want all the groups to be expanded by default.
Keep labels short
Use labels that are clear at a glance:
- label: Site Configuration
path: /configuration/site-configurationAvoid labels that try to explain the whole page:
- label: How to Configure the Main Site Settings
path: /configuration/site-configurationThe page title can be longer. The sidebar label should stay easy to scan.
Match links to real pages
If you create this file:
content/en/configuration/site-configuration.mdUse this route in navigation:
- label: Site Configuration
path: /configuration/site-configurationDo not link to the Markdown file:
- label: Site Configuration
path: /configuration/site-configuration.mdReaders use routes, so navigation should use routes too.
Save and check the sidebar
Save config/navigation/sidenav.yaml.
If your local server is running, the sidebar should update automatically. Click each new link once to make sure it opens the page you expected.