quartz-research-note/layouts/partials/toc.html

10 lines
421 B
HTML
Raw Normal View History

{{ $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)) }}
2022-04-05 06:25:24 +00:00
<aside class="mainTOC">
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
<summary>{{ i18n "toc" }}</summary>
2022-04-05 06:25:24 +00:00
{{ .TableOfContents }}
</details>
</aside>
{{end}}