From 37c9ef6b0d7ec7d48b4f2c80708ada5c016c256b Mon Sep 17 00:00:00 2001
From: Eamon Caddigan
Date: Thu, 20 Jul 2023 19:43:46 -0700
Subject: [PATCH] Displaying update time on single posts
---
layouts/_default/list.html | 4 ++--
layouts/partials/metadata.html | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 0f9bc9d..35c217f 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,9 +1,9 @@
{{ define "main" }}
{{ .Title }}
-{{ range .Pages.ByPublishDate.Reverse }}
+{{ range .Pages.ByLastmod.Reverse }}
{{ partial "metadata.html" . }}
{{ end }}
-{{ end }}
\ No newline at end of file
+{{ end }}
diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html
index c4e49c2..83f1b99 100644
--- a/layouts/partials/metadata.html
+++ b/layouts/partials/metadata.html
@@ -1,9 +1,15 @@
{{ $dateTime := .PublishDate.Format "2006-01-02" }}
+{{ $lastmodTime := .Lastmod.Format "2006-01-02" }}
{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }}
{{ if .PublishDate }}
+{{ if and (ne $lastmodTime $dateTime) (gt .Lastmod .Date) }}
+
+ (first posted )
+{{ else }}
{{ end }}
+{{ end }}
{{ with .Params.tags }}
{{ range . }}