Back to Hugo

Explorer

docs/layouts/_partials/layouts/explorer.html

0.163.1666 B
Original Source

{{/* This is currently not in use, but kept in case I change my mind. */}} {{ define "docs-explorer-section" }} {{ $p := .p }} {{ $level := .level }} {{ $pleft := $level }} {{ if gt $level 0 }} {{ $pleft = add $level 1 }} {{ end }} {{ $pl := printf "pl-%d" $pleft }} {{ $pages := $p.Sections }} {{ range $pages }} {{ $hasChildren := gt (len .Pages) 0 }} {{ $class := cond (eq $level 0) "text-primary hover:text-primary/70" "text-gray-900 dark:text-gray-400 hover:dark:text-gray-300" }}

  • {{ .LinkTitle }} {{ if $hasChildren }} {{ template "docs-explorer-section" (dict "p" . "level" (add $level 1)) }} {{ end }} {{ end }} {{ end }}