Back to top


Add table of contents of any content fragment to the page.

ToC fragment can be used to render Table of Contents of any content fragment from any page. The default behavior is to get the name of the content fragment on the same page:

content = ""

But if you need to get the Table of Contents of other pages, just address them relative to the content directory:

content = "fragments/hero/"


fragment = "toc"
weight = 110
background = "secondary"
content = ""

Code (

fragment = "content"
weight = 111
disabled = true # This is just to prevent rendering of the content on the documentation

# Sample header 1
## Sample header 2
### Sample header 3
## Sample header 2


This fragment renders table of contents of a content fragment. It can be used standalone, or in a slot in list or content fragment.

If it’s standalone, then the content fragment is required.



type: string

Path to the content fragment that you need the table of contents of. This path can be relative to the page or relative to content/ directory.

Global variables are documented as well and have been omitted from this page.