Well, I’ve tried date: "Dec 21 2019"
in my posts, but then the date shows up as Jan 1 0001.
I read https://gohugo.io/getting-started/configuration/#configure-front-matter but that didn’t give me any clues. If anything, it made me a bit more confused:
date = ["date", "publishDate", "lastmod"]
what does this really mean? It seems like the date =
bit is setting .Date
(what’s .Date
? No links or further description found). Okay, let’s assume that’s the under-the-hood jargon for setting the publish date for a set of content. Wait, what’s this?
publishDate = ["publishDate", "date"]
So there’s date
which sets .Date
(?), and then there’s publishDate
which sets(?) … .PublishDate
? What’s the difference?
And then there’s the list of strings, ["date", "publishDate", "lastmod"]
. What is this doing? I assume this is some sort of lookup – first try "date"
, then "publishDate"
… but what does that mean? Where’s the explanation of what these parameters actually do? There’s a bit of explanation for :fileModTime
/ :filename
/ :git
, but beyond that, I don’t see anything.
Looking at the whole snippet:
date = ["date", "publishDate", "lastmod"]
lastmod = [":git", "lastmod", "date", "publishDate"]
publishDate = ["publishDate", "date"]
expiryDate = ["expiryDate"]
Why are these so weirdly self referential? date = ["date" ...
etc. What does that do? They’re also almost the same, "date", "publishDate"
are all in the top 3.
It’s also weird that date
can maybe be set by lastmod
(I assume this means last modified? Not sure why it needs to be shortened?), but a bunch of my files are showing a post date of Jan 1 0001. If the post date can fall back to lastmod
, then you’d think a date of Jan 1 0001 would never show up. Obviously I’m not fully understanding what’s going on.
Is there some documentation introduction I’ve missed where this is all explained? I’ve been poking around in my spare time for the better part of a month (admittedly, I don’t have a lot of spare time) – but I figured this would be pretty plug n play. The documentation looks expansive when scrolling around, but when I actually try to figure stuff out, I fall flat.
Don’t mean to rant here – writing documentation is really hard because it’s pretty inherently written by people who already know the system, and if you know the system, it’s hard to remember what’s obvious and what’s not. I appreciate the amount of documentation that’s been written already – just still a bit confused.