diff options
author | Francesco <tomaselli.fr@gmail.com> | 2024-04-30 22:29:00 +0200 |
---|---|---|
committer | Francesco <tomaselli.fr@gmail.com> | 2024-04-30 22:29:00 +0200 |
commit | 45206aa28f4eea171d6e00be861b5a258281b789 (patch) | |
tree | b9d048ed8fea6a59ed1017e35be5dcb4309f8352 | |
parent | 3b5b22e38dab795fc11e367c30636a3dcd4972fb (diff) |
Added custom list entries date format config
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | layouts/partials/post-entry.html | 10 |
2 files changed, 12 insertions, 2 deletions
@@ -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 @@ <div class="post-line"> - <p class="line-date">{{ .Date.Format "2 Jan 2006" }} </p> + + {{ $dateFormat := "2 Jan 2006"}} + {{ with .Site.Params.listDateFormat }} + {{ $dateFormat = .}} + {{ end }} + + + <p class="line-date">{{ .Date.Format $dateFormat }} </p> + <div> <p class="line-title"> <a href="{{ .RelPermalink }}">{{ .Title }}</a></p> |