From 1710fd720c864dc33f79b15a830c5f1a3726f87b Mon Sep 17 00:00:00 2001 From: Will Faught Date: Tue, 13 Dec 2022 22:35:17 -0800 Subject: [PATCH] Add paigedateformat site parameter --- README.md | 3 ++- layouts/partials/paige-date.html | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79c57fd8..f951b3f2 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,8 @@ pages `content/foo/_index.md`, `content/foo/bar.md`, and page `content/_index.md`. The page date is the publish date, if any; otherwise, it's the creation -date. +date. To change the date format displayed, set the site parameter +`paigedateformat` to a Hugo date format. The home page body has the `stretch`, `center`, `greeting`, and `blurb` parameters from `content/_index.md`, if any; the page content, if any; diff --git a/layouts/partials/paige-date.html b/layouts/partials/paige-date.html index 2a366ac3..1dfffa47 100644 --- a/layouts/partials/paige-date.html +++ b/layouts/partials/paige-date.html @@ -1,3 +1,7 @@ {{ with .PublishDate }} -

+{{ $format := ":date_long" }} +{{ with site.Params.paigedateformat }} +{{ $format = . }} +{{ end }} +

{{ end }}