From 43d8150392cbfedfd500a819863244b62fed2abb Mon Sep 17 00:00:00 2001 From: Nick Savage Date: Mon, 2 Sep 2024 19:57:55 +0100 Subject: [PATCH] Allow the date/time format on the single template to be overridden Example: ```toml [params] singleDateFormat = '2 January 2006' ``` --- layouts/_default/single.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8b01d4c..9282d4e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -22,7 +22,7 @@

{{ with .Date }} {{ $dateMachine := . | time.Format "2006-01-02T15:04:05-07:00" }} - {{ $dateHuman := . | time.Format ":date_long" }} + {{ $dateHuman := . | time.Format (default ":date_long" $.Site.Params.singleDateFormat) }} {{end}} @@ -88,4 +88,4 @@ -{{ end }} \ No newline at end of file +{{ end }}