Create basic structure for mobile menu in HTML DOM

This commit is contained in:
Christian Wolf 2024-01-07 10:42:21 +01:00
parent 1ab1a7b084
commit f477fa5450
3 changed files with 11 additions and 0 deletions

View File

@ -17,6 +17,10 @@
{{- block "main" . -}}{{- end -}}
</div>
</div>
<div class="mobile-menu">
<a id="mobile-menu"></a>
{{- partial "page/mobile-menu" . -}}
</div>
{{- partial "page/footer.html" . -}}
</div>
<div id="overlay" class="hidden">

View File

@ -42,4 +42,5 @@
{{ end }}
</nav>
</div>
<a class="mobile-menu-link" href="#mobile-menu">Menu</a>
</div>

View File

@ -0,0 +1,6 @@
{{ range .Site.Menus.main }}
<div class="level-1"><a href="{{ .URL }}" class="menu-link{{ if $.IsMenuCurrent "main" . }} active{{ end }}">{{ .Title }}</a></div>
{{ range .Children }}
<div class="level-2"><a href="{{ .URL }}" class="menu-link{{ if $.IsMenuCurrent "main" .}} active{{ end}}">{{ .Title }}</a></div>
{{ end }}
{{ end }}