From 3ba85b529594d01b9b6169547dcebb50d1f7b370 Mon Sep 17 00:00:00 2001 From: Francesco Date: Tue, 30 Apr 2024 22:29:00 +0200 Subject: [PATCH] Added custom list entries date format config --- README.md | 4 +++- layouts/partials/post-entry.html | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4a2a0d..efa883b 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,9 @@ homeCollection = 'posts' # Pagination size across all website, this is the same for homepage and single list page paginationSize = 100 # Display summaries under post list entries -listSummaries = false +listSummaries = true +# List entries date format +listDateFormat = '2 Jan 2006' # Social icons [[params.social]] diff --git a/layouts/partials/post-entry.html b/layouts/partials/post-entry.html index 1752768..5c89bca 100644 --- a/layouts/partials/post-entry.html +++ b/layouts/partials/post-entry.html @@ -1,5 +1,13 @@
-

{{ .Date.Format "2 Jan 2006" }}

+ + {{ $dateFormat := "2 Jan 2006"}} + {{ with .Site.Params.listDateFormat }} + {{ $dateFormat = .}} + {{ end }} + + +

{{ .Date.Format $dateFormat }}

+

{{ .Title }}