gokarna-theme / gokarna-hugo

A minimal opinionated theme for Hugo
https://gokarna-hugo.netlify.app
GNU General Public License v3.0
378 stars 146 forks source link

page not generated due to missing timezone information in date frontmatter #254

Open k4lizen opened 1 month ago

k4lizen commented 1 month ago

Doing this: https://github.com/526avijitgupta/gokarna/blob/fc09ce7645eb309dc70796376f0da042b10f9889/archetypes/posts.md?plain=1#L1-L10

is bad. Particularly date: {{ now.Format "2006-01-02" }} ommits necessary timezone information. See https://github.com/gohugoio/hugo/issues/12940 for more information.

k4lizen commented 1 month ago

Though this can be fixed by specifying timeZone = "Local" in the config.

jamesericdavidson commented 1 month ago

Though this can be fixed by specifying timeZone = "Local" in the config.

This would be a good addition to the docs. Feel free to submit a PR.

date: {{ now.Format "2006-01-02" }} ommits necessary timezone information

You can submit a PR which adds timezone offsets to date and lastmod.

exampleSite makes use of time:

https://github.com/gokarna-theme/gokarna-hugo/blob/5d0503b77e84cf688132a4c9cb1c7bcf44c33f18/exampleSite/content/posts/emoji-support.md?plain=1#L3

Though the theme does not render it:

image

@yashmehrotra @526avijitgupta Thoughts on changing archetypes (#241) to add time information?

I prefer yyyy-mm-dd for simplicity and ISO 8601 compliance.