feat: add last modified date to post meta

This commit is contained in:
Marvin Gaube 2023-11-19 08:33:31 +01:00
parent 5a99ab779d
commit e305a1b021
3 changed files with 10 additions and 0 deletions

View File

@ -31,3 +31,6 @@
- id: code_copied - id: code_copied
translation: "Kopiert!" translation: "Kopiert!"
- id: lastmod
translation: "Zuletzt geändert"

View File

@ -31,3 +31,6 @@
- id: code_copied - id: code_copied
translation: "copied!" translation: "copied!"
- id: lastmod
translation: "Last Modified"

View File

@ -4,6 +4,10 @@
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }} {{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }}
{{- end }} {{- end }}
{{- if and (.Param "Lastmod") (ne (.Param "Lastmod"| time.Format "2023-10-15") (.Date | time.Format "2023-10-15" )) }}
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s: %s</span>" (.Lastmod) (i18n "lastmod") (.Lastmod | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }}
{{- end }}
{{- if (.Param "ShowReadingTime") -}} {{- if (.Param "ShowReadingTime") -}}
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} {{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }}
{{- end }} {{- end }}