mirror of
https://github.com/kogakure/website-11ty-kogakure.de.git
synced 2026-02-03 20:25:30 +00:00
25 lines
755 B
Plaintext
25 lines
755 B
Plaintext
<span class="language-switcher">
|
|
{% for lang in site.languages %}
|
|
{% if loop.first %}
|
|
<ul class="language-switcher-list">
|
|
{% endif %}
|
|
|
|
{% set translatedUrl = "/" + lang.language + "/" %}
|
|
{% set activeClass = "is-active" if lang.language == locale else "" %}
|
|
|
|
{% for item in collections.all %}
|
|
{% if item.data.translationKey == translationKey and item.data.locale == lang.language %}
|
|
{% set translatedUrl = item.url %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
<li class="language-switcher-list-item">
|
|
<a class="language-switcher-link {{ activeClass }}" href="{{ translatedUrl }}" data-umami-event="Language Switch {{ lang.title }}">{{ lang.title }}</a>
|
|
</li>
|
|
|
|
{% if loop.last %}
|
|
</ul>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</span>
|