TOC & Include
Insert an inline table of contents or include reusable content from other files using Hugo shortcodes.
TOC Shortcode
Insert a table of contents anywhere in your content:
{{</* toc */>}}This renders an auto-generated list of all headings on the page. Useful when you want the TOC in a specific location rather than the default sidebar position.
The sidebar TOC is controlled by the toc front matter parameter (see Page Features). The {{</* toc */>}} shortcode inserts an inline TOC within the content body.
Include Shortcode
Include the content of another file into your page:
{{</* include "shared/disclaimer.md" */>}}Parameters
| Parameter | Type | Description |
|---|---|---|
| First positional | string | Required. Path to the file to include |
Use Cases
- Shared content — Include a standard disclaimer, license, or notice across multiple pages
- Modular writing — Break long documents into separate files and compose them
- Reusable snippets — Keep common code examples or instructions in one place
Example
## License
{{</* include "partials/mit-license.md" */>}}Included files are processed as Markdown, so they support all formatting features and even other shortcodes.
Was this page helpful?
Citations & Mentions
Cite academic publications and mention author profiles inline using the Hugo cite and mention shortcodes.
Building with HugoBlox
The page builder, theming, content types, and configuration — everything that shapes how your site looks and what it shows.
From the makers of
© 2026 Lore Labs.