From 455f57c422f93db37ecb8097869070aff7ba680c Mon Sep 17 00:00:00 2001 From: Maximilian Wagner Date: Sun, 21 Jul 2024 14:40:03 +0200 Subject: [PATCH] added #1337 from github adityatelange/hugo-PaperMod --- 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 f64aad9..667fbd8 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -9,6 +9,9 @@ one: "1 Minute" other: "{{ .Count }} Minuten" +- id: lastmod + translation: "Zuletzt GeƤndert" + - id: words translation: one : "Wort" diff --git a/i18n/en.yaml b/i18n/en.yaml index 3a1e215..215ac7a 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -9,6 +9,9 @@ one : "1 min" other: "{{ .Count }} min" +- id: lastmod + translation: "Last modified" + - id: words translation: one : "word" diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html index b0c0417..772b81b 100644 --- a/layouts/partials/post_meta.html +++ b/layouts/partials/post_meta.html @@ -8,6 +8,10 @@ {{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} {{- 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 "ShowWordCount") -}} {{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} {{- end }}