From e305a1b0216a019023839e063c031dd921f67793 Mon Sep 17 00:00:00 2001 From: Marvin Gaube Date: Sun, 19 Nov 2023 08:33:31 +0100 Subject: [PATCH] feat: add last modified date to post meta --- i18n/de.yaml | 3 +++ i18n/en.yaml | 3 +++ layouts/partials/post_meta.html | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/i18n/de.yaml b/i18n/de.yaml index f64aad97..7ac96900 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -31,3 +31,6 @@ - id: code_copied translation: "Kopiert!" + +- id: lastmod + translation: "Zuletzt geƤndert" \ No newline at end of file diff --git a/i18n/en.yaml b/i18n/en.yaml index 3a1e2151..34dfb024 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -31,3 +31,6 @@ - id: code_copied translation: "copied!" + +- id: lastmod + translation: "Last Modified" \ No newline at end of file diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html index b0c0417e..d8362406 100644 --- a/layouts/partials/post_meta.html +++ b/layouts/partials/post_meta.html @@ -4,6 +4,10 @@ {{- $scratch.Add "meta" (slice (printf "%s" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }} {{- end }} +{{- if and (.Param "Lastmod") (ne (.Param "Lastmod"| time.Format "2023-10-15") (.Date | time.Format "2023-10-15" )) }} +{{- $scratch.Add "meta" (slice (printf "%s: %s" (.Lastmod) (i18n "lastmod") (.Lastmod | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }} +{{- end }} + {{- if (.Param "ShowReadingTime") -}} {{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} {{- end }}