24 lines
768 B
HTML
24 lines
768 B
HTML
{{- $page := .page -}}
|
|
{{- $menuID := .menuID -}}
|
|
{{- $menuContent := index site.Menus .menuID -}}
|
|
|
|
<ul class="main-nav">
|
|
{{- if compare.Eq $menuID "main" -}}
|
|
<li><a href="/{{ .Site.Home.RelPermalink }}" class="in-nav-home">Home</a></li>
|
|
{{- end }}
|
|
{{- range $menuContent }}
|
|
<li>
|
|
{{- $attrs := dict "href" .URL }}
|
|
{{- if $page.IsMenuCurrent $menuID . -}}
|
|
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
|
|
{{- end -}}
|
|
<a
|
|
{{- range $k, $v := $attrs }}
|
|
{{- with $v }}
|
|
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
|
{{- end }}
|
|
{{- end -}}
|
|
>{{ or (T .Identifier) .Name | safeHTML }}</a></li>
|
|
{{- end }}
|
|
</ul>
|