From d8eaad0f0cecb8838cae1eaf59cb1c226a855462 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Mon, 28 Aug 2023 13:48:46 -0500 Subject: [PATCH] display lastmod date on single sidebar and archive list --- layouts/partials/archive.html | 4 +++- layouts/partials/aside.html | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/layouts/partials/archive.html b/layouts/partials/archive.html index ef270e5..abda6f5 100644 --- a/layouts/partials/archive.html +++ b/layouts/partials/archive.html @@ -12,11 +12,13 @@ {{ range $pages }} +{{- $postDate := .Date.Format "2006-01-02" }} +{{- $updateDate := .Lastmod.Format "2006-01-02" }}

{{ .Title | markdownify }}

diff --git a/layouts/partials/aside.html b/layouts/partials/aside.html index 2311e32..dfad4c5 100644 --- a/layouts/partials/aside.html +++ b/layouts/partials/aside.html @@ -1,8 +1,9 @@ -{{ if or (.Params.description) (.Params.author) (.Params.date) }} +{{- $postDate := .Date.Format "2006-01-02" }} +{{- $updateDate := .Lastmod.Format "2006-01-02" }} +{{ if or (.Params.description) (.Params.date) }} {{ if .Params.description }}

{{ .Params.description }}

{{ end }}

- {{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }} - {{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }} + {{ with $postDate }}{{ . }}{{ end }}{{- if ne $postDate $updateDate }} [{{ $updateDate }}]{{ end }}

{{- with .Params.tags -}}