{{- $showvisitedlinks := .Site.Params.showVisitedLinks }} {{- $format := partial "get-format.hugo" . }} {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- $basename := "index" }} {{- if eq $outputFormat "searchpage" }} {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} {{- end }} {{- define "section-tree-nav" }} {{- $currentNode := .currentnode }} {{- $showvisitedlinks := .showvisitedlinks }} {{- $alwaysopen := .alwaysopen }} {{- $currentFileRelPermalink := .currentnode.RelPermalink }} {{- with .sect }} {{- $isSelf := eq .RelPermalink $currentFileRelPermalink }} {{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }} {{- $isActive := $isSelf }} {{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "hidden" true) }} {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }} {{- if $hidden }} {{- else }} {{- $numberOfVisibleChildren := 0 }} {{- range $pages }} {{- $isSelfSub := eq .RelPermalink $currentFileRelPermalink }} {{- $isAncestorSub := and (not $isSelf) (.IsAncestor $currentNode) }} {{- $relearnIsSubHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- $subHidden := and $relearnIsSubHiddenFrom (not $.showhidden) (not $isSelfSub) (not $isAncestorSub) }} {{- $numberOfVisibleChildren = add $numberOfVisibleChildren (int (not $subHidden)) }} {{- end }} {{- safeHTML .Params.head }} {{- if $numberOfVisibleChildren }} {{- $title := or .LinkTitle .Title }} {{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} {{- $isCollapsible := or (.Params.collapsibleMenu | default .Site.Params.collapsibleMenu) (not $url) }} {{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }} {{- $pageHash := md5 .Page }} {{- $isOpen := or $currentAlwaysopen $isSelf $isAncestor }}
  • {{ if $isCollapsible }}{{ end }}{{ if $url }}{{ else }}{{ end }} {{- partial "menu-pre.html" . }}{{ $title }}{{ partial "menu-post.html" . }} {{- if $url }}{{ if $showvisitedlinks }}{{ end }}{{ else }}{{ end }}
  • {{- else }} {{- $title := or .LinkTitle .Title }} {{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
  • {{ if $url }}{{ else }}{{ end }} {{- partial "menu-pre.html" . }}{{ $title }}{{ partial "menu-post.html" . }} {{- if $url }}{{ if $showvisitedlinks }}{{ end }}{{ else }}{{ end }}
  • {{- end }} {{- end }} {{- end }} {{- end }}