2023-09-18 18:24:49 +00: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 07:13:06 +00:00
|
|
|
{{- if not $currentDisableToc }}
|
2023-09-18 18:24:49 +00:00
|
|
|
{{- $content := partial "toc-class.html" . }}
|
2024-08-27 13:35:48 +00:00
|
|
|
{{- $hascontent := not (eq 0 (int (len (trim ($content | plainify) "\n\r\t ")))) }}
|
2023-09-18 18:24:49 +00:00
|
|
|
{{- if not $hascontent }}
|
|
|
|
{{- $content = " " }}
|
2024-09-11 09:58:10 +00:00
|
|
|
{{- else }}
|
|
|
|
{{- $content = (print "\n" $content) | safeHTML }}
|
2023-09-18 18:24:49 +00: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 07:40:58 +00:00
|
|
|
"hint" (printf "%s (CTRL+ALT+t)" (T "Toc-toggle"))
|
2023-09-18 18:24:49 +00:00
|
|
|
"content" $content
|
|
|
|
)}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|