Last updated

toc

Usage

Use the toc section to control the behavior of page table of contents (TOC) in Markdown and MDX pages. Add it to the top level of the siteConfig.yaml file and configure supported options inside it.

Some of the options can be used in the front matter of MD(X) pages to override the site-wide configuration. Read more about ToC configuration.

When enabled, the page TOC is displayed on the right side of each MD(X) page. Note that the first H1 heading on a page is never included in the TOC. Any subsequent H1 headings are included.

Options

OptionDescriptionFront matter
enableWhen set to true, displays a table of contents (ToC) on the right side of each MD(X) page.✔️
maxDepthThis option is dependent on and related to enable: true. Use it to set the maximum depth (amount of heading levels) displayed in the table of contents. The value must be provided as an integer. The default value is 4, which means that headings from H1 to H4 are displayed in the TOC.✔️

Examples

  1. In siteConfig
  2. In front matter
seo:
  title: Example Developer Portal
  description: Learn how to work with Example APIs
toc:
  enable: true
  maxDepth: 2