Initial work on adding i18n support, drop footer link support (breaking change!)

This commit is contained in:
daudix
2024-06-15 22:36:03 +03:00
parent c1f9247c86
commit a4a68c8b61
25 changed files with 821 additions and 100 deletions

View File

@ -0,0 +1,12 @@
{% if config.extra.language_switcher %}
<div class="lang" aria-label="{{ trans(key="language", lang=lang) }}">
{% set language_agnostic_path = current_path | default(value="/") | replace(from='/' ~ lang ~ '/', to = '/') | trim_start_matches(pat = '/') %}
{% for tr in config.extra.translations %}
{% if tr.code == lang %}
<span class="active">{{ tr.name }}</span>
{% else %}
<a href="{{ get_url(path=language_agnostic_path, lang=tr.code) ~ "/" }}" hreflang="{{ tr.code }}" lang="{{ tr.code }}">{{ tr.name }}</a>
{% endif %}
{% endfor %}
</div>
{% endif %}