From c097ab90ab82e257d961b4122e690d25aeb1f6ea Mon Sep 17 00:00:00 2001
From: Peter Kleiweg <kleiweg@ziggo.nl>
Date: Wed, 13 Jul 2022 11:52:19 +0000
Subject: [PATCH] feat: localized dates (#373)
---
layouts/index.html | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/layouts/index.html b/layouts/index.html
index 486e59f..e8650c4 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -77,11 +77,23 @@
<em class="fas fa-calendar-day"></em>
<span class="post__footer-date"
>{{ if isset .Site.Params "indexdateformat" }}
- {{ .Date.Format .Site.Params.indexDateFormat }}
+ {{ if .Site.Params.localizedDates }}
+ {{ time.Format .Site.Params.indexDateFormat .Date }}
+
+ {{ else }}
+ {{ .Date.Format .Site.Params.indexDateFormat }}
+
+ {{ end }}
{{ else }}
- {{ .Date.Format "Mon, Jan 2, 2006" }}
+ {{ if .Site.Params.localizedDates }}
+ {{ time.Format "Mon, Jan 2, 2006" .Date }}
+
+ {{ else }}
+ {{ .Date.Format "Mon, Jan 2, 2006" }}
+
+ {{ end }}
{{ end }}</span
--
Gitblit v1.10.0