wiki-grav/plugins/language-selector/templates/partials/language-selector.hreflang.html.twig

9 lines
403 B
Twig
Raw Normal View History

{% set langobj = grav['language'] %}
{% for key in language_selector.languages %}
{% if key == language_selector.current %}
{% set lang_url = page.url %}
{% else %}
{% set lang_url = base_url_simple ~ langobj.getLanguageURLPrefix(key) ~ language_selector.page_route ~ page.urlExtension ?: '/' %}
{% endif %}
<link rel="alternate" hreflang="{{ key }}" href="{{ lang_url ~ uri.params }}" />
{% endfor %}