1 hour ago · 6 min read1228 words · Tech · hide · 0 comments

I thought the beginning of this post’s title might catch your eye as it doesn’t sound like what usually appears on my blog! 🤣 But actually it’s a troubleshooting log with Hugo, Indiekit, and being a total noob with Node.js. How Hugo Handles DatesA few weeks ago, I noticed some of my Hugo sort functions weren’t working. For example, I want Hugo to sort the most recent pages based on the date or lastmod front matter parameter (param). Not sure when it broke, or if it was always broke; but it would not sort the date correctly when a page did not contain a lastmod param, i.e., pages with only a date param, despite being newer, would not go to the top of the list. After fiddling with Hugo’s [frontmatter] date config using fallbacks like GitInfo or FileMod times, that actually made things worse. I prefer having an explicit lastmod param set myself. The configuration I settled on is: 1[frontmatter] 2 date = ["date", ":default"] 3 lastmod = ["lastmod"]But while troubleshooting all this, I…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.