ccchh-website/themes/ccchh/layouts/partials/menu.html

32 lines
1.1 KiB
HTML
Raw Normal View History

2023-10-02 12:08:18 +02:00
{{- $page := .page -}}
{{- $menuID := .menuID -}}
{{- $menuContent := index site.Menus .menuID -}}
<ul>
{{- if compare.Eq $menuID "main" -}}
2023-11-03 20:36:12 +01:00
{{- $image := resources.Get "images/logo.svg" }}
2023-10-02 12:08:18 +02:00
<li><a href="/{{ .Site.Home.URL }}"><img src="{{ $image.RelPermalink }}" class="invert-on-light" width="150px" alt="CCCHH Icon"></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>
2023-11-03 20:36:12 +01:00
{{ if compare.Eq $menuID "main" -}}
2023-10-02 12:08:18 +02:00
<ul>
<li class="roomstate" id="roomstate">
<span class="state">unbekannt</span><br><span class="duration">(seit&nbsp;)</span>
</li>
</ul>
2023-11-03 20:36:12 +01:00
{{- end -}}