From c6e682c8b9192924e17fe66f749f2a1caa560710 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Thu, 5 May 2022 21:07:54 -0400 Subject: [PATCH] When updated, posts now show date updated --- assets/css/style.css | 2 ++ layouts/blog/single.html | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index a181b39..159fbc7 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -235,3 +235,5 @@ nav li { } #webmentions img { max-height: 1.2em; margin-right: -1ex; } + +.date-updated { margin-top: -8px; } diff --git a/layouts/blog/single.html b/layouts/blog/single.html index b6d4b4e..d76c2ee 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -2,11 +2,18 @@

{{ .Title }}

{{ partial "header.html" . }} + {{ if not .Date.IsZero }} {{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}} -

Published on

- + {{ $pubdate := .Date.Format $singlePageDateFormat }} +

Published on

+ {{- if .Lastmod }} + {{- $lastmod := .Lastmod.Format $singlePageDateFormat }} + {{- if ne $lastmod $pubdate }} +

Updated on

+ {{- end }} + {{ end }} {{ end }}