2022-09-24 02:17:28 +09:00
|
|
|
{{ $hasHeaders := gt (len (findRE "<h\\d.*?>(.|\n)*?</h\\d>" .Content)) 0 }}
|
2022-11-20 04:18:57 +09:00
|
|
|
{{ if (or (and (not $.Site.Data.config.enableToc) .Params.enableToc) (and $.Site.Data.config.enableToc (ne .Params.enableToc false) $hasHeaders)) }}
|
2022-04-05 15:25:24 +09:00
|
|
|
<aside class="mainTOC">
|
|
|
|
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
2022-08-24 12:32:40 +09:00
|
|
|
<summary>{{ i18n "toc" }}</summary>
|
2022-04-05 15:25:24 +09:00
|
|
|
{{ .TableOfContents }}
|
|
|
|
</details>
|
|
|
|
</aside>
|
|
|
|
{{end}}
|