{{- $context := .context -}} {{- $page := .page -}} {{- $pageLink := .page.RelPermalink -}} {{- range .tree -}} {{- $active := eq $pageLink .link -}} {{- $containsPage := hasPrefix $pageLink .link -}} {{- $shouldOpen := or (.open) $containsPage $active | default false }}
  • {{- template "sidebar-item-link" (dict "context" . "active" $active "title" .title "link" .link) -}} {{- if .section -}} {{- if not $containsPage -}} {{- partialCached "sidebar/render-tree-branch-without-leaf" .section .section -}} {{- else -}} {{- partial "sidebar/render-tree-branch" (dict "context" $context "entry" .section "page" $page) -}} {{- end -}} {{- end -}}
  • {{ end }}