Last updated

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:

  1. If you don't already have a redocly.yaml file, create one and add it to the root of your project.
  2. Add the toc object, under the markdown object. For example:
    markdown:
      toc:
    
  3. 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
    
  4. 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