mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
10 lines
435 B
Twig
10 lines
435 B
Twig
|
{% set langobj = grav['language'] %}
|
||
|
{% for key in langswitcher.languages %}
|
||
|
{% if key == langswitcher.current %}
|
||
|
{% set lang_url = page.url is same as('/') ? '' : page.url %}
|
||
|
{% else %}
|
||
|
{% set lang_url = (langobj.getLanguageURLPrefix(key) ~ langswitcher.page_route ~ page.urlExtension ?: '')|rtrim('/') %}
|
||
|
{% endif %}
|
||
|
<link rel="alternate" hreflang="{{ key }}" href="{{ uri.base ~ lang_url ~ uri.params }}" />
|
||
|
{% endfor %}
|