Back to Docker

Mainnav

layouts/_partials/sidebar/mainnav.html

18.09-release993 B
Original Source

{{- /* Complements the section-specific sidebar navigation. - Renders the main navigation for site sections, linking to the current or ancestor section/page. - Uses the site.Menus.main configuration to determine primary navigation structure. - Toggles visibility of nested menu items for the main sections. */ -}}

{{- $curr := .FirstSection }} {{- if eq $curr site.Home }} {{- $curr = . }} {{- end }} {{- range site.Menus.main }} {{- if or (.Page.IsAncestor page) (eq .Page page) }} {{- $curr = .Page }} {{- end }} {{- end }} {{- with $curr.Params.icon }} {{- partialCached "icon.html" . . -}} {{- end }} {{- $curr.LinkTitle -}} {{ partialCached "icon" "arrow_drop_down" "arrow_drop_down" }} {{ partialCached "icon" "arrow_drop_up" "arrow_drop_up" }}

{{ range site.Menus.main }} {{ if ne page.FirstSection .Page }} - {{- with .Page.Params.icon }} {{- partialCached "icon.html" . . -}} {{- end }} {{- .Name }} {{ end }} {{ end }}