{{ "" | safeHTML }} {{- $menuID := .menuID }} {{- $page := .page }} {{- $open := .open }} {{- $more := eq $menuID "more" }} {{- if eq $menuID "footer" }} {{- with index site.Menus "footer" }} {{- end }} {{- else if index site.Menus $menuID }}
{{ if $more -}} {{ i18n $menuID }} {{- else -}} {{ i18n $menuID }} {{- end }} {{- with index site.Menus $menuID }} {{ if $more }}{{ "" | safeHTML }}{{ end }} {{- end }}
{{- end }} {{- /*---------------------- end of menu.html ----------------------*/}} {{- define "partials/inline/menu/walk.html" -}} {{- $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 }} {{- $attrs = merge $attrs (dict "title" . "aria-label" .) }} {{- 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 }} {{- end }} {{- define "menuItem" }} {{ if not .name }} {{- $tooltip := .identifier }} {{ title $tooltip }} {{- end }} {{- with .icon -}} {{- end }} {{- with .name }} {{ . }} {{- end }} {{- end }} {{- define "menuItemWithChildren" }}
    {{ with .icon }}{{ end }} {{- .name -}} {{- if .deck -}} {{- end }}
    {{- end }}