Handle when Date is equal to Lastmod

This commit is contained in:
Felipe Curty 2025-03-26 23:36:36 -03:00 committed by GitHub
parent b1881f00f5
commit c7e471f466
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,7 @@
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }}
{{- end }}
{{- if not .Lastmod.IsZero -}}
{{- if and (not .Lastmod.IsZero) (not (eq .Date .Lastmod)) -}}
{{- $scratch.Add "meta" (slice (printf "<span title='Last updated %s'>Last updated on %s</span>" (.Lastmod) (.Lastmod | time.Format (default "January 2, 2006" .Site.Params.DateFormat)))) }}
{{- end }}