docs/themes/hugo-geekdoc/layouts/partials/menu-bundle.html
{{ $current := .current }} {{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site }}{{ define "menu-file" }} {{ $current := .current }} {{ $site := .site }}
{{ range sort (default (seq 0) .sect) "weight" }} {{ $name := .name }} {{ if reflect.IsMap .name }} {{ $name = (index .name $site.Language.Lang) }} {{ end }} - {{ $ref := default false .ref }} {{ if $ref }} {{ $this := $site.GetPage .ref }} {{ $icon := default false .icon }} {{ $numberOfPages := (add (len $this.Pages) (len $this.Sections)) }} {{ $isCurrent := eq $current $this }} {{ $isAncestor := $this.IsAncestor $current }} {{ $id := substr (sha1 $this.Permalink) 0 8 }} {{ $doCollapse := and (isset . "sub") (or $this.Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }} {{ $anchor := default "" .anchor }} {{ if $anchor }} {{ $anchor = printf "#%s" $anchor }} {{ end }} {{ if or .external ($this.RelPermalink) }} {{ if $icon }} {{ end }} {{ $name }} {{ if $doCollapse }} {{ end }} {{ end }} {{ else }} {{ $name }} {{ end }} {{ with .sub }} {{ template "menu-file" dict "sect" . "current" $current "site" $site }} {{ end }} {{ end }} {{ end }}