about summary refs log tree commit diff stats
path: root/templates/language_switcher.html
diff options
context:
space:
mode:
authorAlan Pearce2024-02-18 14:59:47 +0100
committerAlan Pearce2024-02-18 20:40:21 +0100
commitd604fa65ddad76100d9061d35b4129e6c6c5771d (patch)
tree61114fffbf69c46b697462ec3aa6c3858ac28572 /templates/language_switcher.html
parenta6000685cfcbb4253f634b44637b599cec96d5bc (diff)
downloadzola-bearblog-d604fa65ddad76100d9061d35b4129e6c6c5771d.tar.lz
zola-bearblog-d604fa65ddad76100d9061d35b4129e6c6c5771d.tar.zst
zola-bearblog-d604fa65ddad76100d9061d35b4129e6c6c5771d.zip
Create optional language switcher
Diffstat (limited to 'templates/language_switcher.html')
-rw-r--r--templates/language_switcher.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/templates/language_switcher.html b/templates/language_switcher.html
new file mode 100644
index 0000000..b82ddfc
--- /dev/null
+++ b/templates/language_switcher.html
@@ -0,0 +1,11 @@
+{% if config.extra.language_switcher %}
+  <nav>
+    {%- for tr in config.extra.translations %}
+      {%- if tr.code == lang %}
+        <strong>{{ tr.name }}</strong>
+      {%- else %}
+        <a href="{{ get_url(path="/", lang=tr.code) }}">{{ tr.name }}</a>
+      {%- endif %}
+    {%- endfor %}
+  </nav>
+{% endif %}