{{- $page := .page }} {{- $menuID := .menuID }} {{- $open := .open }} {{- $main := eq $menuID "main" }} {{- $n := .n }} {{- $n = add $n 1 }} {{- $l := printf "l%d" $n }} {{- $deck := and $main (eq $n 2) }} {{ range .menuEntries -}} {{- $name := .Name }} {{- $attrs := dict "href" .URL }} {{- if $page.IsMenuCurrent .Menu . }} {{- $attrs = merge $attrs (dict "aria-current" "page") }} {{- else if $page.HasMenuCurrent .Menu . }} {{- $attrs = merge $attrs (dict "aria-current" "true") }} {{- end }} {{- $desc := .Post }} {{- if $deck }} {{- $attrs = merge $attrs (dict "class" "on-deck") }} {{- else if $desc }} {{- $attrs = merge $attrs (dict "class" "has-desc") }} {{- end }} {{- $icon := .Pre }} {{- with $icon }} {{- if not $name }} {{- $attrs = merge $attrs (dict "title" . "aria-label" .) }} {{- end }} {{- end }} {{- $identifier := .Identifier }}
  • {{- if .Children }} {{- template "menuItemWithChildren" dict "item" . "attrs" $attrs "icon" $icon "name" $name "desc" $desc "deck" $deck "menuID" $menuID "open" $open "l" $l "n" $n "page" $page }} {{- else }} {{- template "menuItem" dict "attrs" $attrs "name" $name "desc" $desc "icon" $icon "identifier" $identifier }} {{- end }}
  • {{- end }}