From 941ca77a327f595e50e0cd22d35e984afb29530d Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Fri, 29 Mar 2019 16:59:00 +0100 Subject: Rename DateFormat to BookDateFormat, make format optional --- layouts/posts/list.html | 3 ++- layouts/posts/single.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'layouts/posts') diff --git a/layouts/posts/list.html b/layouts/posts/list.html index 9c68a79..18871f2 100644 --- a/layouts/posts/list.html +++ b/layouts/posts/list.html @@ -1,4 +1,5 @@ {{ define "main" }} + {{- $dateFormat := default "January 2, 2006" .Site.Params.BookDateFormat -}} {{ $paginator := .Paginate (where .Pages "Params.hidden" "ne" true) }} {{ range sort .Paginator.Pages }}
@@ -6,7 +7,7 @@ {{ .Title }}
- {{ .Date.Format .Site.Params.DateFormat }} + {{ .Date.Format $dateFormat }}

{{- .Summary -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 36585e5..a7f94ed 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -1,8 +1,9 @@ {{ define "main" }} +{{- $dateFormat := default "January 2, 2006" .Site.Params.BookDateFormat -}}

{{ .Title }}

- {{ .Date.Format .Site.Params.DateFormat }} + {{ .Date.Format $dateFormat }}
-- cgit v1.2.3