Add a table of contents to the single template
Pages can show the table of contents by setting the renderTableOfContents parameter.
This commit is contained in:
parent
3837e77d63
commit
4d303b984e
3 changed files with 42 additions and 0 deletions
|
@ -3,6 +3,13 @@
|
|||
<header class="page-header">
|
||||
{{ partial "page_header.html" (dict "page" .) }}
|
||||
</header>
|
||||
|
||||
{{ if .Params.renderTableofContents | default false }}
|
||||
<details>
|
||||
<summary>{{ i18n "tableOfContents" }}</summary>
|
||||
{{ .TableOfContents }}
|
||||
</details>
|
||||
{{ end }}
|
||||
<footer class="page-footer">
|
||||
{{ partial "page/footer.html" . }}
|
||||
</footer>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue