Navigation Basics
Add pages to the Mordoc side navigation so readers can find them.
In the previous steps, you created a page at:
/my-first-pageThe page exists, but it does not appear in the sidebar yet. Mordoc keeps pages and navigation separate so you can choose which pages readers see in the menu.
In this step, you will add your new page to the sidebar.
Open the navigation file
Open this file:
config/navigation/sidenav.yamlThe starter file looks like this:
- 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 controls the links shown in the sidebar.
Add your page
Add your new page under children:
- label: The Ring
expanded: true
children:
- label: Lore of the Ring
path: /lore
- label: Wielding the Ring
path: /wielding-the-ring
- label: Safeguards
path: /safeguards
- label: My First Page
path: /my-first-pageSave the file.
If your local server is running, the sidebar should update automatically. You should now see My First Page in the sidebar.
What label and path mean
Each navigation item has a label and a path.
- label: My First Page
path: /my-first-pageThe label is what readers see in the sidebar.
The path is the page address that opens when they click the label.
Keep labels simple
Navigation labels should be short and clear.
Good examples:
InstallConfigurationDeploy
Avoid long labels when a shorter one is clear enough.
More navigation options
This page only covers the first sidebar edit.
Later, the Side Navigation page will explain nested groups and expanded groups. The Configuration section will also explain top navigation, header links, and translated navigation labels.