appernetic / hugo-nederburg-theme

Nederburg is a fast and secure hugo theme and is a port of the Tracks WP theme
Other
106 stars 86 forks source link

Date format #51

Closed emoro closed 5 years ago

emoro commented 5 years ago

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?

rdiaz02 commented 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:

And it now works (with the added virtue of allowing me to change the display format by simply changing the config).

emoro commented 5 years ago

It worked!! Many thanks. Strange that you have to get it through a parameter instead of the actual value.

appernetic commented 5 years ago

Great solution! Putting it in the backburner for a PR..