{{ config.title }}
{%- if config.extra.menu %}
    {%- if config.extra.menu %} {% for menu in config.extra.menu %}
  • {%- if lang != config.default_language -%} {{ trans(key=menu.name | safe, lang=lang) }} {%- else -%} {{ menu.name | safe }} {%- endif -%}
  • {% endfor %} {%- endif -%} {# Language switcher #} {# Display the language switcher only if more than one language is available #} {%- if config.languages | length > 0 %}
  • {# Display the current language first in the dropdown #}
    {%- if lang != config.default_language %} {{ trans(key="language_name" | safe, lang=lang) }} {% else %} {{ config.extra.language_name.en }} {%- endif %} {# Loop through all the available languages in the config #} {%- for lcode, language_name in config.extra.language_name -%} {# Skip the current language to avoid linking to the current page #} {%- if lang != lcode -%} {# Check if the language code matches the default language #} {%- if lcode == config.default_language -%} {# If it does, link to the root path (no language code in URL) #} {{ language_name }} {%- else -%} {# Check if the current language is the default language #} {%- if lang == config.default_language -%} {# If it is, append the language code to the base URL #} {{ language_name }} {%- else -%} {# If it's not, replace the current language code in the URL with the new one #} {{ language_name }} {%- endif -%} {%- endif -%} {%- endif -%} {%- endfor -%}
  • {%- endif %} {# Theme switcher #} {%- if config.extra.theme_switcher and config.extra.theme_switcher == true -%}
  • {%- endif -%}
{% endif %}