2023-05-17 10:43:39 +02:00
|
|
|
{{ $.Scratch.Set "counter" 0 }}
|
|
|
|
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
|
|
|
|
|
2023-05-17 09:30:00 +02:00
|
|
|
<header>
|
|
|
|
<div class="header-content">
|
|
|
|
|
2023-06-19 10:20:38 +02:00
|
|
|
<!-- Logo wordt nu benoemd als URL, dus we strippen de eerste slash, vervolgens halen we deze uit de assets directory -->
|
|
|
|
<!-- Logo staat zowel in assets als static, zodat deze gekopieerd worden. Dit is een TODO om te ontdubbelen -->
|
2023-05-20 19:59:58 +02:00
|
|
|
{{ $logoresource := resources.Get (.Site.Params.logoNormal | replaceRE "^/" "") }}
|
|
|
|
|
2023-06-18 14:29:23 +02:00
|
|
|
<a class="logo" href="{{ "/" | relLangURL }}" title="{{ strings.FirstUpper (i18n "back_to_home") }}">
|
|
|
|
<figure>
|
|
|
|
<picture>
|
|
|
|
{{ $isJPG := eq (path.Ext $logoresource) ".jpg" }}
|
|
|
|
{{ $isPNG := eq (path.Ext $logoresource) ".png" }}
|
|
|
|
|
|
|
|
{{ if ($isJPG) -}}
|
|
|
|
{{ $webpPath:= replace $logoresource ".jpg" ".webp" }}
|
2023-06-19 10:20:38 +02:00
|
|
|
{{ $webpPathStatic:= printf "assets/%s" $webpPath }}
|
2023-06-18 14:29:23 +02:00
|
|
|
|
|
|
|
{{ if (fileExists $webpPathStatic) -}}
|
2023-06-19 10:20:38 +02:00
|
|
|
<source srcset="/{{ $webpPath | safeURL }}" type="image/webp">
|
2023-06-18 14:29:23 +02:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ if ($isPNG) -}}
|
|
|
|
{{ $webpPath:= replace $logoresource ".png" ".webp" }}
|
2023-06-19 10:20:38 +02:00
|
|
|
{{ $webpPathStatic:= printf "assets/%s" $webpPath }}
|
2023-05-17 09:30:00 +02:00
|
|
|
|
2023-06-18 14:29:23 +02:00
|
|
|
{{ if (fileExists $webpPathStatic) -}}
|
2023-06-19 10:20:38 +02:00
|
|
|
<source srcset="/{{ $webpPath | safeURL }}" type="image/webp">
|
2023-06-18 14:29:23 +02:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
2023-06-18 14:39:20 +02:00
|
|
|
<img class="max-width" src="{{ .Site.Params.logoNormal | safeURL }}" alt="NLUUG-logo" decoding="async" width="{{ $logoresource.Width }}" height="{{ $logoresource.Height }}">
|
2023-06-18 14:29:23 +02:00
|
|
|
</picture>
|
|
|
|
</figure>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
TODO (2023-06-18) - Deze regel mag weg als blijkt dat bovenstaande manier van laden van het logo goed functioneert
|
|
|
|
<a href="{{ "/" | relLangURL }}" class="logo" title="{{ strings.FirstUpper (i18n "back_to_home") }}"><img class="max-width" src="{{ $logoresource | relURL }}" alt="NLUUG-logo" width="{{ $logoresource.Width }}" height="{{ $logoresource.Height }}"></a>
|
|
|
|
-->
|
2023-05-17 09:30:00 +02:00
|
|
|
<input type="checkbox" id="hamburger" aria-label="menu button">
|
2023-06-19 23:18:06 +02:00
|
|
|
<label for="hamburger" aria-hidden="true"><span> </span></label>
|
2023-05-17 09:30:00 +02:00
|
|
|
|
2023-06-19 23:18:06 +02:00
|
|
|
<nav aria-label="Hoofdmenu">
|
2023-05-17 09:30:00 +02:00
|
|
|
|
2023-06-19 23:18:06 +02:00
|
|
|
<ul class="menus menu" role="menubar" aria-label="Menu bovenzijde">
|
2023-05-17 09:30:00 +02:00
|
|
|
{{ $currentPage := . }}
|
|
|
|
{{ range .Site.Menus.main }}
|
2023-05-22 11:46:34 +02:00
|
|
|
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
|
2023-05-17 11:43:44 +02:00
|
|
|
{{ if .Children }}
|
2023-06-19 23:18:06 +02:00
|
|
|
<li role="none">
|
2023-05-31 11:31:16 +02:00
|
|
|
<!-- <button type="button" aria-haspopup="true" aria-expanded="true" aria-controls="dropdown-{{ $.Scratch.Get "counter" }}" aria-labelledby="button-link-{{ $.Scratch.Get "counter" }}"></button> -->
|
2023-06-19 23:18:06 +02:00
|
|
|
<a id="button-link-{{ $.Scratch.Get "counter" }}" href="{{ .URL }}" role="menuitem" aria-haspopup="true" aria-expanded="true">{{ or (T .Identifier) .Name | strings.FirstUpper | safeHTML }}</a>
|
|
|
|
<ul class="dropdown" id="dropdown-{{ $.Scratch.Get "counter" }}" role="menu">
|
2023-05-17 09:30:00 +02:00
|
|
|
{{ range .Children }}
|
2023-06-19 23:18:06 +02:00
|
|
|
<li role="none"><a href="{{ .URL }}" role="menuitem">{{ or (T .Identifier) .Name | strings.FirstUpper | safeHTML }}</a></li>
|
2023-05-17 09:30:00 +02:00
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
{{ else }}
|
2023-06-19 23:18:06 +02:00
|
|
|
<li role="none">
|
2023-05-31 11:31:16 +02:00
|
|
|
<!-- <button type="button" aria-haspopup="true" aria-expanded="true" aria-labelledby="button-link-{{ $.Scratch.Get "counter" }}"></button> -->
|
2023-06-19 23:18:06 +02:00
|
|
|
<a id="button-link-{{ $.Scratch.Get "counter" }}" href="{{ .URL }}" role="menuitem">{{ or (T .Identifier) .Name | strings.FirstUpper | safeHTML }}</a>
|
2023-05-21 16:21:00 +02:00
|
|
|
</li>
|
2023-05-17 09:30:00 +02:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2024-03-11 14:59:44 +01:00
|
|
|
|
|
|
|
|
2023-05-17 09:30:00 +02:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</div>
|
2023-05-05 16:36:10 +02:00
|
|
|
</header>
|