{{/* We cache this partial for bigger sites and set the active class client side. */}} {{ $shouldDelayActive := ge (len .Site.Pages) 2000 }}
{{ define "section-tree-nav-section-vault" }} {{ $s := .section }} {{ $p := .page }} {{ $fs := .firstSection }} {{ $shouldDelayActive := .delayActive }} {{ $active := eq $p.CurrentSection $s }} {{ $show := or (and (not $p.Site.Params.ui.sidebar_menu_compact) ($p.IsAncestor $s)) ($p.IsDescendant $s) }} {{ $sid := $s.RelPermalink | anchorize }} {{ if eq $s $fs }} {{ range $s.Sections }} {{ template "section-tree-nav-section-vault" (dict "page" $p "section" . "firstSection" $fs) }} {{ end }} {{ else }} {{ if $p.IsDescendant $s }} {{ else }} {{ end }} {{ end }} {{ end }}