about summary refs log tree commit diff stats
path: root/templates
diff options
context:
space:
mode:
authorAlan Pearce2024-02-20 17:04:48 +0100
committerAlan Pearce2024-02-20 17:04:48 +0100
commit21091740f78eb4653cfc7e1dceba6f8856f3d210 (patch)
tree8ded70a5e539fca629ff2401dfe7adf6b507c9aa /templates
parent1c52ee3cc089e6b7ef8f38d1e6530b219239bd2e (diff)
downloadzola-bearblog-21091740f78eb4653cfc7e1dceba6f8856f3d210.tar.lz
zola-bearblog-21091740f78eb4653cfc7e1dceba6f8856f3d210.tar.zst
zola-bearblog-21091740f78eb4653cfc7e1dceba6f8856f3d210.zip
Show language switcher on all pages
Diffstat (limited to 'templates')
-rw-r--r--templates/language_switcher.html8
1 files changed, 2 insertions, 6 deletions
diff --git a/templates/language_switcher.html b/templates/language_switcher.html
index d3cd383..a300028 100644
--- a/templates/language_switcher.html
+++ b/templates/language_switcher.html
@@ -1,15 +1,11 @@
 {% if config.extra.language_switcher %}
   <nav>
-    {%- if current_path %}
-      {%- set language_agnostic_path=current_path | replace(from='/' ~ lang ~ '/', to = '/') | trim_start_matches(pat = '/')  -%}
-    {%- endif %}
+    {%- set language_agnostic_path = current_path | default(value="/") | replace(from='/' ~ lang ~ '/', to = '/') | trim_start_matches(pat = '/') -%}
     {%- for tr in config.extra.translations %}
       {%- if tr.code == lang %}
         <strong>{{ tr.name }}</strong>
       {%- else %}
-        {%- if language_agnostic_path %}
-            <a href="{{ get_url(path=language_agnostic_path, lang=tr.code) }}">{{ tr.name }}</a>
-        {%- endif %}
+          <a href="{{ get_url(path=language_agnostic_path, lang=tr.code) }}">{{ tr.name }}</a>
       {%- endif %}
     {%- endfor %}
   </nav>