table of contents - fitizens/hugo-modules GitHub Wiki
Add the following code to your module list in the config/_default/module.toml
file.
[[imports]]
path = "github.com/gethugothemes/hugo-modules/table-of-contents"
Add the following code to your assets/scss/main.scss
or assets/scss/style.scss
file.
@import 'toc';
[markup.tableOfContents]
startLevel = 2
endLevel = 5
ordered = true
{{< toc >}}
available parameters:
- Class = "your-class"
- Collapsed: display as collapsed | default true
{{ partial "toc.html" }}