I’ve seen a couple of topics on date formatting, but I’m a little confused as to what I can do. For background, I am using Hugo 0.14.
It seems that I cannot have a date in the front matter (using TOML) in the form of “YYYY-MM-DD” because it does not get translated correctly? Or is that incorrect?
I was going off of the date format function mentioned in the documentation.
I’ve noticed that dates are wrong in strange ways on my generated site.
In my gallery (created from the front matter of pages in a section), the date that appears when highlighting is wrong. The date for all 2014 images has the day set to 14 while the date for all 2015 images has the day set to 15. The day of the week is also off (as you can see below where the same day has different day of the week).
In another section (for posts), the same date is shown multiple times while the front matter has a different date for each entry.
I’m using code like {{ .Date.Format "Mon Jan 06, 2006" }}
and {{ $date := dateFormat "Mon Jan 2, 2006" .Date }}
in my theme. I’m not sure if one has a different effect than the other, but both appear to have issues with the way I’ve specified my date in the front matter.
My unfinished theme can be found here: https://github.com/chipsenkbeil/grid-side
My site that is using the theme can be found here: https://github.com/chipsenkbeil/senkbeil.org
I’m currently excluding the themes directory until I finish the theme (so I can have a git submodule pointing to it). If anyone wants to verify what I’m encountering, just create the themes directory and a soft link to the grid side theme.