Add language switcher and language detection

This commit is contained in:
2026-08-11 12:25:14 +02:00
parent 3e7c831dac
commit df489c6c79
11 changed files with 526 additions and 384 deletions
@@ -89,21 +89,7 @@
{{ end }}
<!-- Mobile Language Switcher -->
{{ if hugo.IsMultilingual }}
<div class="py-4 border-t border-gray-200 mt-4">
<div class="text-lg text-gray-600 font-semibold mb-2">{{ i18n "language" }}</div>
{{ range .Site.Languages }}
{{ if eq $.Site.Language.Lang .Lang }}
<span class="block py-2 text-primary-600 font-bold">{{ .LanguageName }}</span>
{{ else }}
{{ $langURL := printf "/%s/" .Lang }}
<a href="{{ $langURL }}" class="language-switch-link block py-2 text-gray-700 hover:text-primary-600" data-lang="{{ .Lang }}">
{{ .LanguageName }}
</a>
{{ end }}
{{ end }}
</div>
{{ end }}
{{ partial "language-switcher-mobile" . }}
{{ if not $headerConfig.hideButtons }}
<div class="pt-4 space-y-4">