mirror of
https://github.com/falsycat/ar.falsy.cat.git
synced 2024-09-03 20:54:51 +00:00
10 lines
421 B
HTML
10 lines
421 B
HTML
{{ $hasHeaders := gt (len (findRE "<h\\d.*?>(.|\n)*?</h\\d>" .Content)) 0 }}
|
|
{{ if (or (and (not $.Site.Data.config.enableToc) .Params.enableToc) (and $.Site.Data.config.enableToc (ne .Params.enableToc false) $hasHeaders)) }}
|
|
<aside class="mainTOC">
|
|
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
|
<summary>{{ i18n "toc" }}</summary>
|
|
{{ .TableOfContents }}
|
|
</details>
|
|
</aside>
|
|
{{end}}
|