{{- /* Renders a menu for the given menu ID. @context {page} page The current page. @context {string} menuID The menu ID. @example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }} */}} {{- $page := .page }} {{- $menuID := .menuID }} {{- $menuClass := .class }} {{- with index site.Menus $menuID }} {{- end }} {{- define "_partials/inline/menu/walk.html" }} {{- $page := .page }} {{- range .menuEntries }} {{- $attrs := dict "href" .URL "class" "" }} {{- if $page.IsMenuCurrent .Menu . }} {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} {{- else if $page.HasMenuCurrent .Menu .}} {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} {{- end }} {{- $attrs = merge $attrs (dict "class" (print $attrs.class " contrast")) }} {{- if (ne .Params.class nil) }} {{- $attrs = merge $attrs (dict "class" (print $attrs.class " " .Params.class)) }} {{- end }} {{- if (ne .Params.rel nil) }} {{- $attrs = merge $attrs (dict "rel" .Params.rel) }} {{- end }} {{- $name := .Name }} {{- with .Identifier }} {{- with T . }} {{- $name = . }} {{- end }} {{- end }}
  • {{- if (ne .Params.iconName nil) }} {{partial "icon.html" (dict "icon" .Params.iconName "label" .Params.iconTitle)}} {{- end }} {{ $name }} {{- with .Children }} {{- end }}
  • {{- end }} {{- end }}