Skip to content

Commit

Permalink
馃悰 fix(404): fix broken language selection from 404 page
Browse files Browse the repository at this point in the history
Fixes #279.
  • Loading branch information
welpo committed Feb 15, 2024
1 parent 274c414 commit 90def02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/partials/language_switcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{#- Check if the current language is the default language -#}
{#- If it is, append the language code to the base URL -#}
{%- elif lang == config.default_language -%}
<a role="menuitem" lang="{{ lcode }}" aria-label="{{ language_name }}" href="{{ config.base_url }}/{{ lcode }}{{ current_path | default(value=" /") | safe }}">{{ language_name }}</a>
<a role="menuitem" lang="{{ lcode }}" aria-label="{{ language_name }}" href="{{ config.base_url }}/{{ lcode }}{{ current_path | default(value="/") | safe }}">{{ language_name }}</a>
{%- else -%}
{#- If it's not, replace the current language code in the URL with the new one -#}
<a role="menuitem" lang="{{ lcode }}" aria-label="{{ language_name }}" href="{{ current_url | replace(from='/' ~ lang ~ '/', to='/' ~ lcode ~ '/') }}">{{ language_name }}</a>
Expand Down

0 comments on commit 90def02

Please sign in to comment.