ccchh-website/themes/ccchh/layouts/partials/menu.html
June 7fa5fea2a9 Style: Make header adaptive by intro. a hamburg. menu for mobile viewp.
Co-authored-by: c6ristian <c6ristian@christian.moe>
2023-11-04 22:32:34 +01:00

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>