Sprachenswitcher des Themes korrigiert um auf LanguageKeys zu korrigieren

This commit is contained in:
Andreas Hnida 2024-03-21 11:59:49 +01:00
commit 03141192e5

View file

@ -10,102 +10,46 @@
</div>
<!-- navbar toggler -->
<input id="nav-toggle" type="checkbox" class="hidden" />
<label
for="nav-toggle"
class="order-3 cursor-pointer flex items-center lg:hidden text-dark lg:order-1">
<label for="nav-toggle" class="order-3 cursor-pointer flex items-center lg:hidden text-dark lg:order-1">
<svg id="show-button" class="h-6 fill-current block" viewBox="0 0 20 20">
<title>Menu Open</title>
<path d="M0 3h20v2H0V3z m0 6h20v2H0V9z m0 6h20v2H0V0z"></path>
</svg>
<svg id="hide-button" class="h-6 fill-current hidden" viewBox="0 0 20 20">
<title>Menu Close</title>
<polygon
points="11 9 22 9 22 11 11 11 11 22 9 22 9 11 -2 11 -2 9 9 9 9 -2 11 -2"
transform="rotate(45 10 10)"></polygon>
<polygon points="11 9 22 9 22 11 11 11 11 22 9 22 9 11 -2 11 -2 9 9 9 9 -2 11 -2" transform="rotate(45 10 10)"></polygon>
</svg>
</label>
<!-- /navbar toggler -->
<!-- main navbar -->
<ul
id="nav-menu"
class="navbar-nav order-3 hidden lg:flex w-full pb-6 lg:order-1 lg:w-auto lg:space-x-2 lg:pb-0 xl:space-x-8">
<ul id="nav-menu" class="navbar-nav order-3 hidden lg:flex w-full pb-6 lg:order-1 lg:w-auto lg:space-x-2 lg:pb-0 xl:space-x-8">
{{ $currentPage := . }}
{{ range site.Menus.main }}
{{ $menuURL := .URL | absLangURL }}
{{ $pageURL:= $currentPage.Permalink | absLangURL }}
{{ $active := eq $menuURL $pageURL }}
{{ if .HasChildren }}
<li class="nav-item nav-dropdown group relative">
<span
class="nav-link {{ range .Children }}
{{ $childURL := .URL | absLangURL }}
{{ $active := eq $childURL $pageURL }}
{{ if $active }}active{{ end }}
{{ end }} inline-flex items-center">
{{ .Name }}
<svg class="h-4 w-4 fill-current" viewBox="0 0 20 20">
<path
d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
<li class="nav-item {{ if .HasChildren }}nav-dropdown group relative{{ end }}">
<a href="{{ .URL | relLangURL }}" class="nav-link {{ if $active }}active{{ end }} inline-flex items-center">
{{ .Name }}
{{ if .HasChildren }}
<svg class="ml-2 h-4 w-4 fill-current" viewBox="0 0 20 20">
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
</svg>
</span>
<ul
class="nav-dropdown-list lg:group-hover:visible lg:group-hover:opacity-100">
{{ end }}
</a>
{{ if .HasChildren }}
<ul class="nav-dropdown-list lg:group-hover:visible lg:group-hover:opacity-100">
{{ range .Children }}
{{ $childURL := .URL | absLangURL }}
{{ $active := eq $childURL $pageURL }}
<li class="nav-dropdown-item">
<a
class="nav-dropdown-link {{ if $active }}
active
{{- end -}}"
{{ if findRE `^http` .URL }}
target="_blank" rel="noopener"
{{ end }}
href="{{- if findRE `^#` .URL -}}
{{- if not $.IsHome -}}
{{- site.Home.RelPermalink -}}
{{- end }}
{{- .URL -}}
{{- else -}}
{{- .URL | relLangURL -}}
{{- end -}}">
<a class="nav-dropdown-link {{ if eq (.URL | absLangURL) $pageURL }}active{{ end }}" href="{{ .URL | relLangURL }}">
{{ .Name }}
</a>
</li>
{{ end }}
</ul>
</li>
{{ else }}
<li class="nav-item">
<a
class="nav-link {{ if $active }}active{{- end -}}"
{{ if findRE `^http` .URL }}
target="_blank" rel="noopener"
{{ end }}
href="{{- if findRE `^#` .URL -}}
{{- if not $.IsHome -}}
{{- site.Home.RelPermalink -}}
{{- end }}{{- .URL -}}
{{- else -}}
{{- .URL | relLangURL -}}
{{- end -}}"
>{{ .Name }}</a
>
</li>
{{ end }}
{{ end }}
{{ if site.Params.navigation_button.enable }}
<li class="mt-4 inline-block lg:hidden">
<a
class="btn btn-outline-primary btn-sm"
href="{{ site.Params.navigation_button.link | relLangURL }}">
{{ site.Params.navigation_button.label }}
</a>
{{ end }}
</li>
{{ end }}
</ul>
<div class="order-1 ml-auto flex items-center md:order-2 lg:ml-0">
{{ with site.Params.search }}
{{ if .enable }}