language-selector.hreflang.html.twig 403 B

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