Skip to content

Commit 5b2b329

Browse files
committed
refactor: Move menu partial into header partial
1 parent 45f04b6 commit 5b2b329

File tree

2 files changed

+59
-61
lines changed

2 files changed

+59
-61
lines changed

layouts/partials/header.html

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,59 @@
1-
{{ partial "menu" (dict "menuID" "main" "page" .) }}
1+
{{ $logo := resources.Get "images/logo.svg" }}
2+
<div class="o-container o-header__wrapper">
3+
<a id="skip-link" class="o-header__skip-link" href="#content">{{ T "skipToContent" }}</a>
4+
<a href="/" aria-label="{{ T "home-page-text" }}" class="o-header__logo">
5+
<img aria-hidden="true" src="{{ $logo.RelPermalink }}" alt="">
6+
</a>
7+
<div class="o-header__curtain"></div>
8+
<div class="o-header__nav o-container">
9+
<li class="o-header__item a-theme-toggle--mobile">
10+
{{ partial "theme-toggle" }}
11+
</li>
12+
<button class="o-nav__menu-button" title="Menü öffnen" aria-expanded="false" aria-haspopup="true">
13+
<span>{{ T "menu-open" }}</span>
14+
{{ partial "icon" "menu" }}
15+
</button>
16+
<nav>
17+
<button class="o-nav__close-button" title="Menü schließen">
18+
<span>{{ T "menu-close" }}</span>
19+
{{ partial "icon" "close" }}
20+
</button>
21+
<menu>
22+
<li class="o-header__item">
23+
<button class="o-header__expand-button" aria-haspopup="true" aria-expanded="false">
24+
<span>{{ T "countries.selection" }}</span>
25+
{{ partial "icon" "keyboard_arrow_down" }}
26+
</button>
27+
<span id="menu-country-list-title">{{ T "country" }}</span>
28+
<menu class="o-header__item-countries" aria-describedby="menu-country-list-title">
29+
{{ range where site.RegularPages "Section" "country"}}
30+
<li class="o-header__item">
31+
<a href="{{ .Permalink }}">{{ .Title }}</a>
32+
</li>
33+
{{ end }}
34+
</menu>
35+
</li>
36+
<li class="o-header__item">
37+
<span id="menu-general-list-title">{{ T "general" }}</span>
38+
<ul aria-describedby="menu-general-list-title">
39+
<li class="o-header__item a-theme-toggle--desktop">
40+
{{ partial "theme-toggle" }}
41+
</li>
42+
{{ $news := site.GetPage "news" }}
43+
{{ if $news }}
44+
<li class="o-header__item">
45+
<a href="{{ $news.RelPermalink }}">{{ $news.Title }}</a>
46+
</li>
47+
{{ end }}
48+
{{ $informationPage := site.GetPage "generalInformation" }}
49+
{{ if $informationPage }}
50+
<li class="o-header__item">
51+
<a href="{{ $informationPage.RelPermalink }}">{{ $informationPage.Title }}</a>
52+
</li>
53+
{{ end }}
54+
</ul>
55+
</li>
56+
</menu>
57+
</nav>
58+
</div>
59+
</div>

layouts/partials/menu.html

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)