Add paige_toc parameter

master
Will Faught 3 years ago
parent 1ae2515d27
commit 17343628dc

@ -188,6 +188,7 @@ Optional page parameters:
link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title
math: true # Enable math typesetting with KaTeX
paige_hide_search: true # Don't include this page in search results
paige_toc: true # Show a table of contents if there are any headers
```
Additional optional home page parameters:

@ -1,3 +1,14 @@
{{ with .Content }}
{{ . | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a class="paigeheaderlink" href="#${2}"><i class="bi bi-link-45deg small"></i></a>${3}` | safeHTML }}
{{ if .Content }}
{{ if and .Params.paige_toc (ne .TableOfContents `<nav id="TableOfContents"></nav>`) }}
<section>
<div class="container-fluid mb-3">
<div class="justify-content-center row">
<div class="border col col-auto pe-3 ps-3 pt-3 rounded">
{{ .TableOfContents }}
</div>
</div>
</div>
</section>
{{ end }}
{{ .Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a class="paigeheaderlink" href="#${2}"><i class="bi bi-link-45deg small"></i></a>${3}` | safeHTML }}
{{ end }}

Loading…
Cancel
Save