Configure navigation on the TOC (table of contents)
Every markdown page includes a table of contents (TOC) that is automatically generated based on the headings. You can configure navigation on the TOC by updating the title for the TOC and setting the depth.
Update title and depth
You can update the title and set the depth for the TOC for all or select pages of your portal.
To update the title and set the depth of the TOC:
- If you don't already have a
redocly.yaml
file, create one and add it to the root of your project. - Add the
toc
object, under themarkdown
object. For example:markdown: toc:
- Add the
header
option with the value for the updated title. For example, the following configuration updates the header text for your TOC to "Page headings":markdown: toc: header: Page headings
- Add the
depth
option with the value for how many levels you want included in the TOC. For example, the following configuration updates the header text for your TOC to "Page headings" and the depth to include only level 2 headings:markdown: toc: header: Page headings depth: 2