Keeps logo size across languages and resolves mobile menu overlap #68

Merged
stb merged 14 commits from layout-fixes into main 2026-11-07 21:28:53 +01:00
12 changed files with 151 additions and 21 deletions
Showing only changes of commit 1846441465 - Show all commits

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

Vincent Mahnke 2026-11-07 13:40:09 +01:00
Signed by: ViMaSter
GPG key ID: 6D787326BA7D6469

3
.gitmodules vendored
View file

@ -1,3 +1,4 @@
[submodule "themes/zen"]
path = themes/zen
url = https://github.com/frjo/hugo-theme-zen.git
url = ssh://forgejo@git.hamburg.ccc.de/ViMaSter/hackertours-theme.git
branch = hackertours-mobile-nav

7
data/lucideicons.json Normal file
View file

@ -0,0 +1,7 @@
{
"house": "<svg class=\"icon\" focusable=\"false\" aria-hidden=\"true\" 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\" ><path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\" /><path d=\"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" /></svg>",
"rss": "<svg class=\"icon\" focusable=\"false\" aria-hidden=\"true\" 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\" ><path d=\"M4 11a9 9 0 0 1 9 9\" /><path d=\"M4 4a16 16 0 0 1 16 16\" /><circle cx=\"5\" cy=\"19\" r=\"1\" /></svg>",
"calendar": "<svg class=\"icon\" focusable=\"false\" aria-hidden=\"true\" 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\" ><path d=\"M8 2v3\" /><path d=\"M16 2v3\" /><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" /><path d=\"M3 9h18\" /></svg>",
"circle-question-mark": "<svg class=\"icon\" focusable=\"false\" aria-hidden=\"true\" 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\" ><circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" /><path d=\"M12 17h.01\" /></svg>",
"languages": "<svg class=\"icon\" focusable=\"false\" aria-hidden=\"true\" 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\" ><path d=\"m5 8 6 6\" /><path d=\"m4 14 6-6 2-3\" /><path d=\"M2 5h12\" /><path d=\"M7 2h1\" /><path d=\"m22 22-5-10-5 10\" /><path d=\"M14 18h6\" /></svg>"
}

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>

View file

@ -0,0 +1,16 @@
<svg
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"
>
<path d="M8 2v3" />
<path d="M16 2v3" />
<rect x="3" y="3" width="18" height="18" rx="2" />
<path d="M3 9h18" />
</svg>

After

Width:  |  Height:  |  Size: 329 B

View file

@ -0,0 +1,15 @@
<svg
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"
>
<circle cx="12" cy="12" r="10" />
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
<path d="M12 17h.01" />
</svg>

After

Width:  |  Height:  |  Size: 322 B

View file

@ -0,0 +1,14 @@
<svg
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"
>
<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" />
<path d="M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
</svg>

After

Width:  |  Height:  |  Size: 383 B

View file

@ -0,0 +1,18 @@
<svg
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"
>
<path d="m5 8 6 6" />
<path d="m4 14 6-6 2-3" />
<path d="M2 5h12" />
<path d="M7 2h1" />
<path d="m22 22-5-10-5 10" />
<path d="M14 18h6" />
</svg>

After

Width:  |  Height:  |  Size: 362 B

View file

@ -0,0 +1,16 @@
<svg
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"
>
<path d="M15 18h-5" />
<path d="M18 14h-8" />
<path d="M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2" />
<rect width="8" height="4" x="10" y="6" rx="1" />
</svg>

After

Width:  |  Height:  |  Size: 416 B

@ -1 +1 @@
Subproject commit 6d4ee822a88a3dbe2443b2c985523e376f47056f
Subproject commit 945820ec5b526065c796ede14dc44a4a4f0a3335