From d12d24411ea573ae3b49a61ee674ba6b03746d67 Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Sun, 10 Nov 2019 14:54:22 +0700 Subject: [PATCH] single and list - add last mod date display, float right params - add .LastModDisplay string to enable/disable --- layouts/_default/list.html | 7 +++++++ layouts/_default/single.html | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4eec511..ae2912a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -17,6 +17,13 @@ {{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }} + {{ if $.Site.Params.LastModDisplay}} + {{ with .Lastmod }} + + {{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }} + + {{ end }} + {{ end }} {{ end }} {{ with .Params.Author }}— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}{{ end }} {{ if $.Site.Params.ShowReadingTime }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 262bc6c..1173f71 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,6 +7,17 @@ {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }} {{ end }} + + {{ if $.Site.Params.LastModDisplay}} + {{ if .Date }} + {{ with .Lastmod }} + + {{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }} + + {{ end }} + {{ end }} + {{ end }} + {{ with .Params.Author }}— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}{{ end }} {{ if $.Site.Params.ShowReadingTime }} — {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}