{{- $currentNode := . }} {{- if eq .Site.Params.ordersectionsby "title"}} {{- range .Site.Home.Sections.ByTitle}} {{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "level" 0}} {{- end}} {{- else}} {{- range .Site.Home.Sections.ByWeight}} {{- if not (hasPrefix .Section "_") -}} {{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "level" 0}} {{end}} {{- end}} {{- end}} {{- define "section-tree-nav" }} {{- $currentNode := .currentnode }} {{- $level := .level }} {{- $maxlevel := 99 }} {{if lt $level $maxlevel }} {{- with .sect}} {{- if and .IsSection (or (not .Params.hidden) $.showhidden)}} {{- $numberOfPages := (len .Sections) }} {{- $numberOfPages := (len (where .Sections "Params.subpage" "ne" true)) }} {{- safeHTML .Params.head}}
  • {{$menuTitle := .Title}} {{if eq $menuTitle ""}}{{$menuTitle = .CurrentSection}}{{end}} {{if gt $level 0 }} {{safeHTML .Params.Pre}}{{$menuTitle}}{{safeHTML .Params.Post}} {{end}} {{- if and (ne $numberOfPages 0) (lt (add $level 1) $maxlevel) }} {{- if or (.IsAncestor $currentNode) (.Params.alwaysopen) }} {{- else -}} {{- end}} {{- end}} {{if eq $level 0 }} {{safeHTML .Params.Pre}}{{$menuTitle}}{{safeHTML .Params.Post}} {{end}} {{- if ne $numberOfPages 0 }} {{- end}}
  • {{- end}} {{- end}} {{- end}} {{- end}}