Navigation
This guide will show you how you can customize your Doks project’s navigation.
Sidebar
A well-organized sidebar is key to a good documentation as it is one of the main ways users will navigate your site. Doks provides a complete set of options to customize your sidebar layout and content.
Default navigation
By default, Doks will automatically generate a sidebar based on the filesystem structure of your documentation, using each file’s title
property as the sidebar entry.
For example, given the following file structure:
The following sidebar will be automatically generated:
Menu navigation
Make sure to:
- use
pageRef
in stead ofurl
and - omit the trailing slash
In stead of using the default navigation, you can define sidebar_<section>
entries in config/_default/menus/menus.<language>.toml
— for example:
Child sections — like guides
and reference
in the example above — will get automatically generated.
Settings
Sections can be collapsed by default by setting the collapsed
property to true
in the frontmatter of a section’s _index.md
:
Other main sections
Sidebar navigation is also available for other docs
based sections you create — for example when you run the following command:
And add the new tutorials
section to config/_default/params.toml
:
Main
Define main entries in config/_default/menus/menus.<language>.toml
:
Social
Define social entries in config/_default/menus/menus.<language>.toml
:
Copy the icon SVG from Tabler Icons by clicking “Copy SVG”.
Footer
Define footer entries in config/_default/menus/menus.<language>.toml
:
Page
The “On this page” (Table of Contents) section is automatically generated. You can set the levels you’d like to show in ./config/_default/markup.toml
: