This repository has been archived on 2024-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
fediversity_website/themes/nluug/layouts/partials/header.html

48 lines
2.3 KiB
HTML
Raw Normal View History

{{ $.Scratch.Set "counter" 0 }}
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
<header>
<div class="header-content">
{{ $logoresource := resources.Get (.Site.Params.logoNormal | replaceRE "^/" "") }}
<a href="{{ "/" | relLangURL }}" class="logo" title="Terug naar hoofdpagina"><img class="max-width" src="{{ $logoresource | relURL }}" alt="NLUUG-logo" width="{{ $logoresource.Width }}" height="{{ $logoresource.Height }}"></a>
<input type="checkbox" id="hamburger" aria-label="menu button">
<label for="hamburger"><span></span></label>
<nav aria-label="Main navigation">
<ul class="menus menu">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
{{ if .Children }}
<li>
<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>
<ul class="dropdown" id="dropdown-{{ $.Scratch.Get "counter" }}">
{{ range .Children }}
2023-05-29 16:26:40 +02:00
<li><a href="{{ .URL }}">{{ or (T .Identifier) .Name | strings.FirstUpper | safeHTML }}</a></li>
{{ end }}
</ul>
</li>
{{ else }}
<li>
<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>
</li>
{{ end }}
{{ end }}
<li>
2023-05-29 16:26:40 +02:00
{{ $search := safeHTML (strings.FirstUpper (i18n "search")) }}
<button type="button" aria-haspopup="false" aria-expanded="true" aria-label="{{ $search }}"></button>
<a href="{{ relLangURL "/zoeken/" }}">
{{ partial "show-svg-icon.html" (dict "context" . "icon" "magnifying-glass" "title" $search) }}
</a>
</li>
</ul>
</nav>
</div>
</header>