Use hugo 0.87's date formatting feature with time.Format (#555)

This commit is contained in:
Saxodwarf 2021-12-26 09:22:10 +01:00 committed by GitHub
parent 4e2558d93c
commit c59193fc48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
{{- $scratch := newScratch }}
{{- if not .Date.IsZero -}}
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date.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 }}
{{- if (.Param "ShowReadingTime") -}}