Closed emoro closed 5 years ago
(Take this with many grains of salt, since I am a total newby with hugo and go): I had the same problem, but got it solved (taking ideas from https://discourse.gohugo.io/t/parsing-dates-in-templates/603/10) by:
config.toml
I added , under [params]
, DateForm = "2 January 2006"
single.html
, after .Date.Format
I removed to string and now have: {{ .Date.Format .Site.Params.DateForm}}
And it now works (with the added virtue of allowing me to change the display format by simply changing the config).
It worked!! Many thanks. Strange that you have to get it through a parameter instead of the actual value.
Great solution! Putting it in the backburner for a PR..
Hi all. Love the Nederburg theme. I am trying to modify the date that appears on top of the posts from being "21 December" to "21 December 2018". In single.html I was trying to change {{.Date.Format "02 January"}} to {{.Date.Format "02 January 2000"}} but I get "21 December 21000". Do I have to use other Hugo date formats?