{#- Copyright (c) 2026 Humberto Sandmann and contributors SPDX-License-Identifier: MIT Language selector, replacing the theme's partial. Shows the current language in the header, and links to the current page in other languages, falling back to their home pages if the page doesn't exist there. -#} {% set i18n = config.extra.i18n %} {% if i18n %} {% if config.theme.variant == "modern" %} {% set check = "lucide/check" %} {% set chevron = "lucide/chevron-down" %} {% else %} {% set check = "material/check" %} {% set chevron = "material/chevron-down" %} {% endif %} {% set icon = config.theme.icon.alternate or "material/translate" %} {#- The base URL is absolute on some pages, e.g., 404 pages, where it's the site root without site URL, so we add the language's prefix -#} {% set root = (base_url ~ "/") | replace("//", "/") %} {% set absolute = not config.site_url and base_url[:1] == "/" %} {% if absolute %} {% set root = root ~ i18n.prefix %} {% endif %}