2023-09-18 20:24:49 +02:00
|
|
|
{{- $onempty := cond (isset . "onempty") .onempty "hide" }}
|
|
|
|
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
|
|
|
|
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
|
|
|
|
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
|
|
|
|
{{- with .page }}
|
|
|
|
{{- $defaultDisableToc := .Site.Params.disableToc | default false }}
|
|
|
|
{{- $currentDisableToc := .Params.disableToc | default $defaultDisableToc }}
|
2024-08-27 09:13:06 +02:00
|
|
|
{{- if not $currentDisableToc }}
|
2023-09-18 20:24:49 +02:00
|
|
|
{{- $content := partial "toc-class.html" . }}
|
2024-08-27 15:35:48 +02:00
|
|
|
{{- $hascontent := not (eq 0 (int (len (trim ($content | plainify) "\n\r\t ")))) }}
|
2023-09-18 20:24:49 +02:00
|
|
|
{{- if not $hascontent }}
|
|
|
|
{{- $content = " " }}
|
2024-09-11 11:58:10 +02:00
|
|
|
{{- else }}
|
|
|
|
{{- $content = (print "\n" $content) | safeHTML }}
|
2023-09-18 20:24:49 +02:00
|
|
|
{{- end }}
|
|
|
|
{{- partial "topbar/func/button.html" (dict
|
|
|
|
"page" .
|
|
|
|
"class" "topbar-button-toc"
|
|
|
|
"href" "javascript:toggleTopbarFlyout(this)"
|
|
|
|
"icon" "list-alt"
|
|
|
|
"onempty" $onempty
|
|
|
|
"onwidths" $onwidths
|
|
|
|
"onwidthm" $onwidthm
|
|
|
|
"onwidthl" $onwidthl
|
2023-12-05 08:40:58 +01:00
|
|
|
"hint" (printf "%s (CTRL+ALT+t)" (T "Toc-toggle"))
|
2023-09-18 20:24:49 +02:00
|
|
|
"content" $content
|
|
|
|
)}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|