add basic language switcher

This commit is contained in:
Lyn Fugmann 2024-09-14 11:32:32 +02:00
parent 61415ce5a7
commit 9011b604d2

View file

@ -1,6 +1,13 @@
<footer>
<div>
<div>[language switcher]</div>
{% set otherLang = page.url | locale_links | first %}
<a href="{{otherLang.url}}" lang="{{otherLang.lang}}" hreflang="{{otherLang.lang}}">
{% if otherLang.lang == "de" %}
Deutsche Version 🇩🇪
{% else %}
English Version 🇬🇧/🇺🇸
{% endif %}
</a>
<nav>
{{ collections.footerNav | pageLang | eleventyNavigation | eleventyNavigationToHtml | safe }}
</nav>