mirror of
https://github.com/hyzendust/hyzendust.github.io.git
synced 2026-02-15 00:01:11 +01:00
14 lines
557 B
HTML
14 lines
557 B
HTML
{{ $tocAvailable := gt (len .TableOfContents) 32 }} {{- /* length of empty TOC is 32 */ -}}
|
|
{{ $tocEnabled := default site.Params.toc .Params.toc }}
|
|
{{ $tocFolded := default site.Params.tocFolded .Params.tocFolded }}
|
|
{{ $tocStatus := "" }} {{- /* folded by default */ -}}
|
|
{{ if eq $tocFolded false }}
|
|
{{ $tocStatus = " open" }}
|
|
{{ end }}
|
|
|
|
{{ if and $tocEnabled $tocAvailable }}
|
|
<details class="toc"{{ $tocStatus | safeHTMLAttr }}>
|
|
<summary class="toc__summary">{{ i18n "tableOfContents" }}</summary>
|
|
{{ .TableOfContents }}
|
|
</details>
|
|
{{ end }} |