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">
|
|
|
|
<label for="hamburger"><span></span></label>
|
|
|
|
|
2023-05-20 19:59:58 +02:00
|
|
|
<nav aria-label="Main navigation">
|
2023-05-17 09:30:00 +02:00
|
|
|
|
|
|
|
<ul class="menus menu">
|
|
|
|
{{ $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-05-17 09:30:00 +02:00
|
|
|
<li>
|
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-05-29 16:26:40 +02:00
|
|
|
<a id="button-link-{{ $.Scratch.Get "counter" }}" href="{{ .URL }}">{{ or (T .Identifier) .Name | strings.FirstUpper | safeHTML }}</a>
|
2023-05-20 19:59:58 +02:00
|
|
|
<ul class="dropdown" id="dropdown-{{ $.Scratch.Get "counter" }}">
|
2023-05-17 09:30:00 +02:00
|
|
|
{{ range .Children }}
|
2023-05-29 16:26:40 +02:00
|
|
|
<li><a href="{{ .URL }}">{{ or (T .Identifier) .Name | strings.FirstUpper | safeHTML }}</a></li>
|
2023-05-17 09:30:00 +02:00
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
{{ else }}
|
2023-05-21 16:21:00 +02:00
|
|
|
<li>
|
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-05-29 16:26:40 +02:00
|
|
|
<a id="button-link-{{ $.Scratch.Get "counter" }}" href="{{ .URL }}">{{ 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 }}
|
2023-05-21 16:21:00 +02:00
|
|
|
<li>
|
2023-05-29 16:26:40 +02:00
|
|
|
{{ $search := safeHTML (strings.FirstUpper (i18n "search")) }}
|
2023-05-31 11:31:16 +02:00
|
|
|
<!-- <button type="button" aria-haspopup="false" aria-expanded="true" aria-label="{{ $search }}"></button> -->
|
2023-05-29 16:26:40 +02:00
|
|
|
<a href="{{ relLangURL "/zoeken/" }}">
|
|
|
|
{{ partial "show-svg-icon.html" (dict "context" . "icon" "magnifying-glass" "title" $search) }}
|
|
|
|
</a>
|
2023-05-21 16:21:00 +02:00
|
|
|
</li>
|
2023-06-01 21:25:09 +02:00
|
|
|
<li>
|
|
|
|
{{ $text := safeHTML (strings.FirstUpper (i18n "ledendeel")) }}
|
|
|
|
<a href="https://leden.nluug.nl/leden/">
|
|
|
|
{{ partial "show-svg-icon.html" (dict "context" . "icon" "user" "title" $text) }}
|
|
|
|
</a>
|
|
|
|
</li>
|
2023-05-17 09:30:00 +02:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</div>
|
2023-05-05 16:36:10 +02:00
|
|
|
</header>
|