From a6000685cfcbb4253f634b44637b599cec96d5bc Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 18 Feb 2024 13:58:34 +0100
Subject: Create basic German version of website
---
templates/nav.html | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
(limited to 'templates/nav.html')
diff --git a/templates/nav.html b/templates/nav.html
index a71652e..cd2d391 100644
--- a/templates/nav.html
+++ b/templates/nav.html
@@ -1,9 +1,16 @@
+{% set current_lang = config.default_language %}
+{% if page %}
+ {% set current_lang = page.lang %}
+{% elif section %}
+ {% set current_lang = section.lang %}
+{% endif %}
{%- if config.extra.main_menu %}
{%- for item in config.extra.main_menu %}
+ {% set language_key = 'name_' ~ current_lang %}
{%- if item.url is matching("https?://") %}
- {{ item.name }}
+ {{ item[language_key] }}
{%- else %}
- {{ item.name }}
+ {{ item[language_key] }}
{%- endif %}
{%- endfor %}
{%- endif -%}
--
cgit 1.4.1