github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/docs/themes/hugo-theme-relearn/layouts/partials/topbar/button/toc.html (about) 1 {{- $onempty := cond (isset . "onempty") .onempty "hide" }} 2 {{- $onwidths := cond (isset . "onwidths") .onwidths "show" }} 3 {{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }} 4 {{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }} 5 {{- with .page }} 6 {{- $format := partial "get-format.hugo" . }} 7 {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} 8 {{- $defaultDisableToc := .Site.Params.disableToc | default false }} 9 {{- $currentDisableToc := .Params.disableToc | default $defaultDisableToc }} 10 {{- if and (eq $outputFormat "html") (not $currentDisableToc) }} 11 {{- $content := partial "toc-class.html" . }} 12 {{- $hascontent := not (eq 0 (int (len (trim ($content | plainify) "\n\r\t ")))) }} 13 {{- if not $hascontent }} 14 {{- $content = " " }} 15 {{- end }} 16 {{- partial "topbar/func/button.html" (dict 17 "page" . 18 "class" "topbar-button-toc" 19 "href" "javascript:toggleTopbarFlyout(this)" 20 "icon" "list-alt" 21 "onempty" $onempty 22 "onwidths" $onwidths 23 "onwidthm" $onwidthm 24 "onwidthl" $onwidthl 25 "hint" (printf "%s (CTRL+ALT+t)" (T "Toc-toggle")) 26 "content" $content 27 )}} 28 {{- end }} 29 {{- end }}