about summary refs log tree commit diff stats
path: root/templates
diff options
context:
space:
mode:
authorAlan Pearce2024-02-18 13:58:34 +0100
committerAlan Pearce2024-02-18 20:40:21 +0100
commita6000685cfcbb4253f634b44637b599cec96d5bc (patch)
tree14bbf91452f561d8a5b084985a409efa4e5238b0 /templates
parent5a936b5c413b541c5523da6b4ebdc46f996f7360 (diff)
downloadzola-bearblog-a6000685cfcbb4253f634b44637b599cec96d5bc.tar.lz
zola-bearblog-a6000685cfcbb4253f634b44637b599cec96d5bc.tar.zst
zola-bearblog-a6000685cfcbb4253f634b44637b599cec96d5bc.zip
Create basic German version of website
Diffstat (limited to 'templates')
-rw-r--r--templates/footer.html2
-rw-r--r--templates/nav.html11
-rw-r--r--templates/section.html8
-rw-r--r--templates/taxonomy_list.html2
-rw-r--r--templates/taxonomy_single.html2
5 files changed, 16 insertions, 9 deletions
diff --git a/templates/footer.html b/templates/footer.html
index c952a93..6d4f0f7 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -1,5 +1,5 @@
 <footer>
   {%- if not config.extra.hide_made_with_line %}
-    Made with <a href="https://codeberg.org/alanpearce/zola-bearblog">Zola ʕ•ᴥ•ʔ Bear</a>
+    {{ trans(key="made_with", lang=lang) }} <a href="https://codeberg.org/alanpearce/zola-bearblog">Zola ʕ•ᴥ•ʔ Bear</a>
   {%- endif %}
 </footer>
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?://") %}
-      <a href="{{ item.url }}">{{ item.name }}</a>
+      <a href="{{ item.url }}">{{ item[language_key] }}</a>
     {%- else %}
-      <a href="{{ get_url(path=item.url, lang=lang )}}">{{ item.name }}</a>
+      <a href="{{ get_url(path=item.url, lang=lang )}}">{{ item[language_key] }}</a>
     {%- endif %}
   {%- endfor %}
 {%- endif -%}
diff --git a/templates/section.html b/templates/section.html
index f3c218a..9560719 100644
--- a/templates/section.html
+++ b/templates/section.html
@@ -3,9 +3,9 @@
 {% block main %}
   <main>
     {%- if taxonomy.term %}
-      <h3 class="filter">Filtering for "{{ section.title }}"</h3>
+      <h3 class="filter">{{ trans(key="filtering_for",lang=lang)}} "{{ section.title }}"</h3>
       <small>
-        <a href="{{ get_url(path="@/blog/_index.md", lang=lang) }}">Remove filter</a>
+        <a href="{{ get_url(path="@/blog/_index.md", lang=lang) }}">{{ trans(key="remove_filter", lang=lang) }}</a>
       </small>
     {%- endif %}
     <ul class="blog-posts">
@@ -22,13 +22,13 @@
         </li>
         {% else %}
         <li>
-          No posts yet
+          {{ trans(key="no_posts", lang=lang) }}
         </li>
       {% endfor %}
     </ul>
     <small>
       <div>
-        {% set tags = get_taxonomy(kind="tags") %}
+        {% set tags = get_taxonomy(kind="tags", lang=lang) %}
         {% for post in tags.items %}
           <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp;
         {% endfor %}
diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html
index 98b8fc9..4b4e08a 100644
--- a/templates/taxonomy_list.html
+++ b/templates/taxonomy_list.html
@@ -5,7 +5,7 @@
     <h1>{{ taxonomy.name | capitalize }}</h1>
     <small>
       <div>
-        {% set tags = get_taxonomy(kind="tags") %}
+        {% set tags = get_taxonomy(kind="tags", lang=lang) %}
         {% for post in tags.items %}
           <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp;
         {% endfor %}
diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html
index 0f640a2..a8ca536 100644
--- a/templates/taxonomy_single.html
+++ b/templates/taxonomy_single.html
@@ -22,7 +22,7 @@
         </li>
       {% else %}
         <li>
-          No posts yet
+          {{ trans(key="no_posts", lang=lang) }}
         </li>
       {% endfor %}
     </ul>