Closed maneesha closed 4 months ago
This should be set globally. Just to test this out though, I changed the date format in terms.html from {{ .Date.Format "2006-02-03" }}
to {{ .Date.Format "2 April, 2006"}}
.
Note also that our dates are generally in ISO format (YYYY-MM-DD). So from what I understand of how Hugo formats dates, even with the short date format, it should be "2006-01-02"
@maneesha I have updated the date format on those pages. There is no way to set a default date format in Hugo, so I adjusted as needed.
Thanks @AdamChlan It looks like we can set a date format in the site params and use it in the theme. I just tried it and it works, but that is not really what we want. Is it possible to set params at the theme level?
We can use a parameter which could be overridden by the project. Something like:
{{ date.Format (site.Params "date_format" | default "2 April, 2006") }}
@maneesha I merged in work to get this in place the best way for Hugo. You can see the work in this PR:
https://github.com/carpentries/tnd-carpentries-working/pull/93
The date format across the site should be: 10 May, 2024.
Examples where this should apply: