diff options
author | Joseph Rollins <rollins.joseph+git@gmail.com> | 2021-04-15 18:25:31 +0300 |
---|---|---|
committer | Joseph Rollins <rollins.joseph+git@gmail.com> | 2021-04-15 18:25:31 +0300 |
commit | 9781081df0ce23b52020916a3bff8e33092c0f1f (patch) | |
tree | 28149ff8da757801c416e329a20230b5b9af660e | |
parent | 03ceebc9e4ccb8077ff346c74369bb35fb0b365f (diff) |
Add optional `postDateFormat` param
This param allows theme users to override the date format display
for post dates. This includes the date for the article on the homepage
(summary) and the date for the article on the article's page (page-header).
-rw-r--r-- | layouts/partials/page-header.html | 4 | ||||
-rw-r--r-- | layouts/partials/summary.html | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/layouts/partials/page-header.html b/layouts/partials/page-header.html index 6aeb563..8aef02b 100644 --- a/layouts/partials/page-header.html +++ b/layouts/partials/page-header.html @@ -13,8 +13,8 @@ {{- partial "tags.html" . -}} <time class="text-eucalyptus-500 md:text-right md:flex-grow font-light pl-4" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> - {{- .Date.Format "2006-1-2 15:04" -}} + {{- .Date.Format (.Site.Params.PostDateFormat | default "2006-1-2 15:04") -}} </time> </div> {{ partial "toc.html" . }} -<hr />
\ No newline at end of file +<hr /> diff --git a/layouts/partials/summary.html b/layouts/partials/summary.html index 935b91a..7d91d48 100644 --- a/layouts/partials/summary.html +++ b/layouts/partials/summary.html @@ -17,7 +17,7 @@ {{- partial "tags.html" . -}} <time class="text-eucalyptus-500 md:text-right md:flex-grow font-light" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> - {{- .Date.Format "2006-1-2 15:04" -}} + {{- .Date.Format (.Site.Params.PostDateFormat | default "2006-1-2 15:04") -}} </time> </div> -</div>
\ No newline at end of file +</div> |