refactor: Mobile footer directly shows menu options
Some checks failed
/ build (pull_request) Failing after 12s
/ accessibility (pull_request) Failing after 21s

This commit is contained in:
Vincent Mahnke 2026-11-07 13:40:09 +01:00
commit 1846441465
Signed by: ViMaSter
GPG key ID: 6D787326BA7D6469
4 changed files with 151 additions and 21 deletions

View file

@ -48,3 +48,4 @@ og:image:alt.
{{- end -}}
{{- end -}}
{{- end -}}

View file

@ -0,0 +1,12 @@
{{- /*
Render a Lucide icon from the local icons data file.
Usage: {{ partial "icon" "house" }}
Icons are fetched from data/lucideicons.json at build time
*/ -}}
{{- $iconName := . -}}
{{- with index hugo.Data.lucideicons $iconName -}}
{{- . | safeHTML -}}
{{- else -}}
{{- /* Fallback if icon not found */ -}}
<svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><circle cx="12" cy="12" r="10"/></svg>
{{- end -}}

View file

@ -0,0 +1,14 @@
{{- /* Inline language selector for mobile bottom nav */ -}}
<ul class="mobile-bottom-nav__lang-list">
{{ if .IsTranslated -}}
{{ range .Translations -}}
<li><a rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Site.Language.Locale | default .Language.Name }}" lang="{{ .Site.Language.Locale | default .Language.Name }}">{{ .Language.Label }}</a></li>
{{ end -}}
{{ else -}}
{{ range hugo.Sites -}}
{{ if ne $.Language.Name .Language.Name -}}
<li><a rel="alternate" href="{{ .Home.RelPermalink }}" hreflang="{{ .Language.Locale | default .Language.Name }}" lang="{{ .Language.Locale | default .Language.Name }}">{{ .Language.Label }}</a></li>
{{ end -}}
{{ end -}}
{{ end -}}
</ul>

View file

@ -1,22 +1,38 @@
<div class="mobile-nav" dir="ltr" hidden>
<div class="mobile-nav__cover"></div>
<button class="mobile-nav__toggle button{{ if $.Param "mobilemenuoutline" }} button--outline{{ end }}" aria-expanded="false" aria-controls="sheet">
{{ i18n "menu_mobile" }}
<svg class="mobile-nav__hamburger" viewBox="0 0 100 100" focusable="false" aria-hidden="true">
<rect width="80" height="12" x="10" y="20" rx="5"></rect>
<rect width="80" height="12" x="10" y="45" rx="5"></rect>
<rect width="80" height="12" x="10" y="70" rx="5"></rect>
</svg>
</button>
<div class="mobile-nav__sheet link-nav" id="sheet" data-theme="dark" aria-hidden="true">
<div class="mobile-nav__region">{{ if hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end }}</div>
<nav class="mobile-nav__main-menu" aria-label="{{ i18n "menu_title" }}">
<ul class="mobile-nav__navbar">
<nav class="mobile-bottom-nav" aria-label="{{ i18n "menu_title" }}">
<ul class="mobile-bottom-nav__list">
{{ $currentPage := . -}}
{{ range site.Menus.main -}}
<li><a href="{{ .URL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} aria-current="page"{{ end }}>{{ .Pre }}<span>{{ .Name }}</span>{{ .Post }}</a></li>
<li class="mobile-bottom-nav__item">
<a href="{{ .URL }}" class="mobile-bottom-nav__link" {{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}aria-current="page"{{ end }} aria-label="{{ .Name }}">
{{ if eq .Name "Home" }}
{{ partial "icon" "house" }}
{{ else if eq .Name "News" }}
{{ partial "icon" "rss" }}
{{ else if eq .Name "Touren" "Tours" }}
{{ partial "icon" "calendar" }}
{{ else if eq .Name "FAQ" }}
{{ partial "icon" "circle-question-mark" }}
{{ else }}
{{ .Pre }}{{ .Post }}
{{ end }}
<span class="mobile-bottom-nav__label">{{ .Name }}</span>
</a>
</li>
{{ end -}}
</ul>
</nav>
</div>
</div>
{{ if hugo.IsMultilingual }}
<li class="mobile-bottom-nav__item">
{{ if eq .Lang "en" }}
<a href="{{ .Permalink | replaceRE "/en/" "/de/" }}" class="mobile-bottom-nav__link" aria-label="Deutsch" rel="alternate" hreflang="de">
{{ partial "icon" "languages" }}
<span class="mobile-bottom-nav__label">Deutsch</span>
</a>
{{ else }}
<a href="{{ .Permalink | replaceRE "/de/" "/en/" }}" class="mobile-bottom-nav__link" aria-label="English" rel="alternate" hreflang="en">
{{ partial "icon" "languages" }}
<span class="mobile-bottom-nav__label">English</span>
</a>
{{ end }}
</li>
{{ end }}
</ul>
</nav>