mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
feat: add last modified date to post meta
This commit is contained in:
parent
5a99ab779d
commit
e305a1b021
@ -31,3 +31,6 @@
|
|||||||
|
|
||||||
- id: code_copied
|
- id: code_copied
|
||||||
translation: "Kopiert!"
|
translation: "Kopiert!"
|
||||||
|
|
||||||
|
- id: lastmod
|
||||||
|
translation: "Zuletzt geändert"
|
@ -31,3 +31,6 @@
|
|||||||
|
|
||||||
- id: code_copied
|
- id: code_copied
|
||||||
translation: "copied!"
|
translation: "copied!"
|
||||||
|
|
||||||
|
- id: lastmod
|
||||||
|
translation: "Last Modified"
|
@ -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 }}
|
||||||
|
Loading…
Reference in New Issue
Block a user