summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-04-18 09:29:56 +0200
committerAlan Pearce2023-04-18 09:29:56 +0200
commit4df500c33f3d3ba7b9387a2bc0447850a04d15c8 (patch)
treeb9c18bc823af212dac3e67c39b5cc92f0faa18ae
parent98d10546684524418a7f612cc75085b5ddc5cfaa (diff)
downloadwebsite-4df500c33f3d3ba7b9387a2bc0447850a04d15c8.tar.lz
website-4df500c33f3d3ba7b9387a2bc0447850a04d15c8.tar.zst
website-4df500c33f3d3ba7b9387a2bc0447850a04d15c8.zip
Make date format configurable
-rw-r--r--config.toml1
-rw-r--r--templates/page.html2
-rw-r--r--templates/section.html2
-rw-r--r--templates/taxonomy_single.html2
-rw-r--r--theme.toml1
5 files changed, 5 insertions, 3 deletions
diff --git a/config.toml b/config.toml
index 36946e6..ca8d27a 100644
--- a/config.toml
+++ b/config.toml
@@ -19,6 +19,7 @@ taxonomies = [
 highlight_code = true
 
 [extra]
+date_format="%d %b, %Y"
 
 [[extra.main_menu]]
 name = "Bear"
diff --git a/templates/page.html b/templates/page.html
index bf9eca7..6651d15 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -11,7 +11,7 @@
 <p>
   <i>
     <time datetime='{{ page.date | date(format='%+') }}' pubdate>
-      {{ page.date | date(format="%d %b, %Y") }}
+      {{ page.date | date(format=config.extra.date_format) }}
     </time>
   </i>
 </p>
diff --git a/templates/section.html b/templates/section.html
index ae365a8..c0808f8 100644
--- a/templates/section.html
+++ b/templates/section.html
@@ -14,7 +14,7 @@
       <span>
         <i>
           <time datetime='{{ page.date | date(format='%+') }}' pubdate>
-            {{ page.date | date(format="%d %b, %Y") }}
+            {{ page.date | date(format=config.extra.date_format) }}
           </time>
         </i>
       </span>
diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html
index 6afb6b2..fb65874 100644
--- a/templates/taxonomy_single.html
+++ b/templates/taxonomy_single.html
@@ -14,7 +14,7 @@
       <span>
         <i>
           <time datetime='{{ page.date | date(format='%+') }}' pubdate>
-            {{ page.date | date(format="%d %b, %Y") }}
+            {{ page.date | date(format=config.extra.date_format) }}
           </time>
         </i>
       </span>
diff --git a/theme.toml b/theme.toml
index 5cc75e0..ed137c8 100644
--- a/theme.toml
+++ b/theme.toml
@@ -12,6 +12,7 @@ demo = "https://alanpearce.codeberg.page/zola-bearblog"
 # be merged with user data, some kind of prefix or nesting is preferable
 # Use snake_casing to be consistent with the rest of Zola
 [extra]
+date_format="%d %b, %Y"
 
 [author]
 name = "Alan Pearce"