public-web/layouts/partials/menu.html

32 lines
1.3 KiB
HTML
Raw Normal View History

2024-07-16 03:19:06 +02:00
<nav class="bg-gray-100 dark:bg-gray-800 fixed inset-0 z-10 overflow-y-auto py-4 lg:hidden" x-show="menuOpen" x-transition>
<div class="container px-6 mx-auto">
<h2 class="sr-only">{{ i18n "menu_title" }}</h2>
<div class="flex flex-wrap gap-2 items-center justify-end mb-8">
<span class="lg:hidden self-start">
{{ partial "language-selector.html" . }}
</span>
<button class="button button--icon block lg:hidden" x-on:click="menuOpen = false">
<span class="sr-only">{{ i18n "menu_close_label" }}</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-6"><path fill="none" d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></svg>
</button>
</div>
<ul class="grid gap-4">
{{ range site.Menus.main }}
{{ $isActive := false }} {{/* TODO fix */}}
<li>
<a
href="{{ .URL | relLangURL }}"
class="font-bold link {{ if $isActive }}link--active{{ end }}"
{{ if $isActive }}
aria-current="page"
{{ end }}
{{ with .Params.target }}
target="{{ . }}"
{{ end }}
>{{ .Name }}</a>
</li>
{{ end }}
</ul>
</div>
2022-10-20 19:39:49 +02:00
</nav>