Print ordinal date suffixes (st/nd/rd/th)

You are passing the wrong value to your partial.

If this is your partial:

{{ $format := .format }}
{{ $date := .date }}
{{- $shortend := humanize $date.Day -}}
{{- return $date.Format (printf $format $shortend) -}}

Pass it this:

dict "format" "January %s, 2006 at 15:04 UTCMST:00" "date" .Lastmod

Not this:

dict "format" "January 2%s, 2006 at 15:04 UTCMST:00" "date" .Lastmod

Further testing of humanize if you’re curious:

{{ range seq 1 248 }}
  {{ humanize . }}<br>
{{ end }}
1 Like