ccchh-website/themes/ccchh/layouts/partials/menu.html
June 75cdbad994
All checks were successful
/ build (push) Successful in 12s
Style: Make header adaptive by intro. a hamburg. menu for mobile viewp.
Co-authored-by: c6ristian <c6ristian@christian.moe>
2024-01-27 23:14:41 +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>