A Site Navigation Menu (siteNav for short) can be used to show a road map of the main pages of your site.
Steps to add a siteNav:
- Format your siteNav as an unordered Markdown list
- Include it under a
<site-nav>
element. - (Optional) To make siteNav accessible on smaller screens, you can use the
<site-nav-button />
component in the navbar.
CODE:
<site-nav>
* [**Getting Started**](/userGuide/gettingStarted.html)
* **Authoring Contents** :expanded:
* [Overview](/userGuide/authoringContents.html)
* [Adding Pages](/userGuide/addingPages.html)
* [MarkBind Syntax Overview](/userGuide/markBindSyntaxOverview.html)
* [Formatting Contents](/userGuide/formattingContents.html)
* [Using Components](/userGuide/usingComponents.html)
</site-nav>
OUTPUT:
- Authoring Contents
MarkBind has styles nested lists with additional padding and smaller text sizes up to 4 nesting levels. Beyond that, you'd have to include your own styles.
Expanding menu items by default
You can append the :expanded:
to a to make it expand by default. In the example above, * Docs :expanded:
will make the menu item Docs
expand by default.
A parent menu item that is also linked will not be collapsible e.g., the Search
menu item in the above example.