[i18n-localize-dates-hugo-0.87] Improve date localization and bump Hugo version to 0.87 to support the new Date.Format. Ref https://gohugo.io/functions/dateformat/

This commit is contained in:
roneo.org
2022-08-18 14:27:45 +02:00
parent eba92edd83
commit 3b2bae0f26
5 changed files with 8 additions and 6 deletions

View File

@ -1,7 +1,9 @@
{{- $scratch := newScratch }}
{{- if not .Date.IsZero -}}
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }}
<span class="date">
{{ .Date | time.Format (default ":date_long" site.Params.DateFormat)}}
</span>
{{- end }}
{{- if (.Param "ShowReadingTime") -}}