A Dating Matter: Hugo, Indiekit, and Node Light _ □ ✕
  • Posts
  • About
  • Debug
Post

A Dating Matter: Hugo, Indiekit, and Node

Published
2026-08-01 16:01 UTC (precision: second)
Author
Naty S
Source feed
BurgeonLab: Firehose [exclude this blog]
Link
https://burgeonlab.com/blog/date-objects-hugo-javascript-node/
Canonical
https://burgeonlab.com/blog/date-objects-hugo-javascript-node
Length
7201 runes
Extracted text
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 Dates A 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 realized all date values, be it lastmod or date, were within quote marks—making them “strings” instead of actual date values (if I understand that correctly). Maybe that is why it wasn’t processing correctly as it can’t be parsed as a string? This was probably why my Hugo conditionals were failing, but I can’t be certain. Remove Quote Marks Fixing existing date params with VSCodium’s search and replace was very simple with my favourite—Regex! All date type params had quote marks removed by using this search pattern: date = "([^']+)" and replaced with date = $1. Making sweeping changes like this though is always a little nerve wracking for me. Luckily Git has some features that help which I’ve learnt over the last few years; like stashing current changes so it doesn’t interfere with the “find and replace” operation, and making the operation a single commit means I can always revert in case of any problems. Here’s the working Hugo conditional I now use to generate a list of all my slash pages, in reverse chronological order (last edited one at the top): 1{{ $sortedPages := .Pages.ByLastmod.Reverse }} 2{{ range (.Paginate $sortedPages).Pages }} 3 {{ partial "entry.html" . }} 4{{ end }} Indiekit Managed Content But what about the Markdown files created by Indiekit? My notes, photos, likes (and recently added: replies, RSVPs, books) are managed separately with Indiekit, the micropub server + client; i.e., the Markdown files are not created by me using the hugo new command within my IDE. Dates in the front matter of Indiekit-managed posts are wrapped in quote marks and that bugged me—I wanted all date params to be consistent, with no quotes. I bravely went to have a look at the code that controls this behaviour: Indiekit’s publication preset for Hugo. Node Noob Fixing this was a way more difficult as it was Node.js territory. Despite my web dev and techy explorations recently with Quartz—where I was exposed to more Node.js, npm, npx, JS, TS, and React components—I am still a total noob in this area. Indiekit was the first Node app I configured and used, and now Quartz. To be honest, now that I’m using two Node apps rather extensively, I should probably invest a day or two trying to understand how Node.js actually work so I can customize and use them more proficiently. But with documentation, and by trial and error, I’m slowly picking up on how the files relate to each other in Node packages, on a very basic level; but I digress. Creating My First Indiekit Custom Plugin for Hugo I forked the official preset-hugo npm package and made custom changes to the post-template.js so it would capture the dates as objects first before it stringifies the value. Full disclosure: trying to work out how to edit the plugin from existing code patterns and references from other Node projects that dealt with date objects didn’t cut it; so I got some help from an LLM chatbot; namely Qwen Coder locally via Ollama and Claude Haiku from Duck.ai. (I’ve written a spin-off about using LLMs this way while writing this post. I’ll link to it when it is published.) Here’s the repo to my custom plugin if you’re interested: I referred to Ricardo’s Indiekit custom plugins (he has a lot) to set up mine. By the way, his site is super neat, full of IndieWeb awesomeness; check it out! Installing the Custom Plugin When I thought the hard part was over, installing the plugin was actually more fiddly! My Indiekit server runs as a Docker container on my Pi. It took me a few tries before I got the server to see the custom plugin. Not sure which action caused it to work (unfortunately, I tried multiple things in one go); or if these are even valid actions, but here were some actions I took: Remove the package.lock and node_modules, then run npm install to fetch fresh updates. Bump the version number in package.json to trigger a new fetch. Make sure the minimum Node version requirement matches for the plugin and the main Indiekit app. Run docker compose build --no-cache to build a fresh container with new packages instead of stale ones, then docker compose down && docker compose up -d I was testing the plugin in local mode at the beginning and realized I had to switch to a remote Git repo for the Pi to access the new plugin. Unfortunately, I think npm only supports github:username/repo-name syntax for installs; so I resorted to using GitHub to host my node packages. I would have preferred if I could use Codeberg or SourceHut. Originally, I used NPM’s override feature to install my custom fork of preset-hugo in the Indiekit config, but I think running npm ci broke that override, and it just kept using the original @indiekit/preset-hugo plugin instead of the custom one. I ended up uninstalling the official plugin and installed mine, @eclecticpassions/preset-hugo and updated indiekit.config.js. npm Registry I have visited the npm site before, but never really understood how it works. The documentation is thorough and understandable—so I decided to create an account there! Hope to add a few more packages there in the near future as I learn to make plugins for Quartz and Indiekit. Conclusion Luckily, it worked in the end, but it was midnight by then so I went to bed. The following day, I tidied up the repos, wrote some notes for this post, and feeling quite content that the problem is solved. Happy I gained new Node.js experience from this troubleshooting session. 👩🏻‍💻 Thanks for reading! If you are a Node person and see some glaring mistake, I’d appreciate it a lot if you let me know so I can make corrections. Cheers! Resources Creating a package.json file An introduction to the npm package manager Creating and Publishing npm Packages Publishing Node.js packages Indiekit API Addendum I actually created a new Hugo shortcode while writing this post! The automatically fetched Open Image of the GitHub repo is a new feature on this site. Here’s a sneak peek at the workflow (and an excuse to make a new D2 diagram). I’ll link to the post about it when it’s done. [For up-to-date content, visit BurgeonLab directly (XML feeds don't fetch updates in real-time). For topic-specific feeds, visit /subscribe. Thanks for reading my blog using a RSS reader!]
Stored topics

Every stored assignment is listed, including rows below the current cutoff (0.75), so a missing tag can be explained.

Concept Code Score Meter Margin Origin Path
science and technology science-and-technology 0.98 3.91 direct science and technology
economy, business and finance economy-business-and-finance 0.87 1.91 ↑derived from local:software-development economy, business and finance
products and services products-and-services 0.87 1.91 ↑derived from local:software-development economy, business and finance > products and services
computing and information technology computing-and-information-technology 0.87 1.91 ↑derived from local:software-development economy, business and finance > products and services > computing and information technology
software and applications software-and-applications 0.87 1.91 ↑derived from local:software-development economy, business and finance > products and services > computing and information technology > software and applications
Software development software-development 0.87 1.91 direct economy, business and finance > products and services > computing and information technology > software and applications > Software development
Open source open-source 0.66 0.65 direct economy, business and finance > products and services > computing and information technology > software and applications > Open source
technology and engineering technology-and-engineering 0.41 -0.37 ↑derived from local:information-security science and technology > technology and engineering
information technology and computer science information-technology-and-computer 0.41 -0.37 ↑derived from local:information-security science and technology > technology and engineering > information technology and computer science
Information security information-security 0.41 -0.37 direct science and technology > technology and engineering > information technology and computer science > Information security
artificial intelligence artificial-intelligence 0.08 -2.50 direct science and technology > technology and engineering > information technology and computer science > artificial intelligence
media and entertainment industry media-and-entertainment-industry 0.05 -3.05 ↑derived from 20000306 economy, business and finance > products and services > media and entertainment industry
books and publishing books-and-publishing 0.05 -3.05 direct economy, business and finance > products and services > media and entertainment industry > books and publishing
arts, culture, entertainment and media arts-culture-entertainment-and-media 0.02 -3.74 ↑derived from 20000013 arts, culture, entertainment and media
arts and entertainment arts-and-entertainment 0.02 -3.74 ↑derived from 20000013 arts, culture, entertainment and media > arts and entertainment
literature literature 0.02 -3.74 direct arts, culture, entertainment and media > arts and entertainment > literature
Cryptography cryptography 0.01 -4.22 direct science and technology > technology and engineering > information technology and computer science > Cryptography
lifestyle and leisure lifestyle-and-leisure 0.01 -4.29 ↑derived from local:tabletop-gaming lifestyle and leisure
leisure leisure 0.01 -4.29 ↑derived from local:tabletop-gaming lifestyle and leisure > leisure
game game 0.01 -4.29 ↑derived from local:tabletop-gaming lifestyle and leisure > leisure > game
Tabletop gaming tabletop-gaming 0.01 -4.29 direct lifestyle and leisure > leisure > game > Tabletop gaming
video game video-game 0.01 -4.39 ↑derived from local:mmorpg lifestyle and leisure > leisure > game > video game
MMORPG mmorpg 0.01 -4.39 direct lifestyle and leisure > leisure > game > video game > MMORPG
sport sport 0.01 -4.48 ↑derived from 20001183 sport
competition discipline competition-discipline 0.01 -4.48 ↑derived from 20001183 sport > competition discipline
eSports esports 0.01 -4.48 direct sport > competition discipline > eSports
streaming service streaming-service 0.01 -4.63 direct economy, business and finance > products and services > media and entertainment industry > streaming service
disaster, accident and emergency incident disaster-accident-and-emergency-incident 0.01 -4.78 direct disaster, accident and emergency incident
health health 0.01 -4.83 ↑derived from 20000458 health
disease and condition disease-and-condition 0.01 -4.83 ↑derived from 20000458 health > disease and condition
mental health and disorder mental-health-and-disorder 0.01 -4.83 direct health > disease and condition > mental health and disorder
scientific research scientific-research 0.01 -4.86 ↑derived from 20000739 science and technology > scientific research
scientific exploration scientific-exploration 0.01 -4.86 ↑derived from 20000739 science and technology > scientific research > scientific exploration
space exploration space-exploration 0.01 -4.86 direct science and technology > scientific research > scientific exploration > space exploration
Self-hosting self-hosting 0.01 -4.92 direct economy, business and finance > products and services > computing and information technology > Self-hosting
education education 0.01 -5.05 direct education
crime, law and justice crime-law-and-justice 0.00 -5.35 ↑derived from 20000086 crime, law and justice
crime crime 0.00 -5.35 ↑derived from 20000086 crime, law and justice > crime
cyber crime cyber-crime 0.00 -5.35 direct crime, law and justice > crime > cyber crime
society society 0.00 -5.36 ↑derived from 20000780 society
family family 0.00 -5.36 direct society > family
film industry film-industry 0.00 -5.39 direct economy, business and finance > products and services > media and entertainment industry > film industry
mass media mass-media 0.00 -5.44 ↑derived from local:blogging arts, culture, entertainment and media > mass media
social media social-media 0.00 -5.44 ↑derived from local:blogging arts, culture, entertainment and media > mass media > social media
Blogging blogging 0.00 -5.44 direct arts, culture, entertainment and media > mass media > social media > Blogging
natural science natural-science 0.00 -5.61 ↑derived from 20000719 science and technology > natural science
biology biology 0.00 -5.61 direct science and technology > natural science > biology
politics and government politics-and-government 0.00 -5.71 direct politics and government
consumer goods consumer-goods 0.00 -6.37 ↑derived from 20001160 economy, business and finance > products and services > consumer goods
handicrafts handicrafts 0.00 -6.37 direct economy, business and finance > products and services > consumer goods > handicrafts
fundamental rights fundamental-rights 0.00 -6.38 ↑derived from 20001300 society > fundamental rights
privacy privacy 0.00 -6.38 direct society > fundamental rights > privacy
conflict, war and peace conflict-war-and-peace 0.00 -6.49 direct conflict, war and peace
television television 0.00 -6.73 direct arts, culture, entertainment and media > mass media > television
board game board-game 0.00 -6.90 direct lifestyle and leisure > leisure > game > board game
human interest human-interest 0.00 -6.91 direct human interest
labour labour 0.00 -6.97 direct labour
exercise and fitness exercise-and-fitness 0.00 -7.02 direct lifestyle and leisure > wellness > exercise and fitness
wellness wellness 0.00 -7.02 ↑derived from 20001239 lifestyle and leisure > wellness
podcast podcast 0.00 -7.06 direct economy, business and finance > products and services > media and entertainment industry > podcast
health treatment and procedure health-treatment-and-procedure 0.00 -7.12 ↑derived from 20000465 health > health treatment and procedure
diet diet 0.00 -7.12 direct health > health treatment and procedure > diet
culture culture 0.00 -7.35 direct arts, culture, entertainment and media > culture
animation animation 0.00 -7.47 direct arts, culture, entertainment and media > arts and entertainment > animation
religion religion 0.00 -7.54 direct religion
social sciences social-sciences 0.00 -7.66 ↑derived from 20000747 science and technology > social sciences
history history 0.00 -7.66 direct science and technology > social sciences > history
environment environment 0.00 -7.77 direct environment
award and prize award-and-prize 0.00 -7.79 direct human interest > award and prize
card game card-game 0.00 -8.03 direct lifestyle and leisure > leisure > game > card game
weather weather 0.00 -8.11 direct weather
climate change climate-change 0.00 -8.16 direct environment > climate change
hobby hobby 0.00 -8.27 ↑derived from 20000568 lifestyle and leisure > leisure > hobby
food and drink enthusiasm food-and-drink-enthusiasm 0.00 -8.27 direct lifestyle and leisure > leisure > hobby > food and drink enthusiasm
visual arts visual-arts 0.00 -8.34 ↑derived from 20000036 arts, culture, entertainment and media > arts and entertainment > visual arts
photography photography 0.00 -8.34 direct arts, culture, entertainment and media > arts and entertainment > visual arts > photography
weather forecast weather-forecast 0.00 -8.38 direct weather > weather forecast
lifestyle lifestyle 0.00 -8.38 ↑derived from 20001257 lifestyle and leisure > lifestyle
house and home house-and-home 0.00 -8.38 ↑derived from 20001257 lifestyle and leisure > lifestyle > house and home
gardening gardening 0.00 -8.38 direct lifestyle and leisure > lifestyle > house and home > gardening
public health public-health 0.00 -8.47 direct health > public health
travel and tourism travel-and-tourism 0.00 -8.51 direct lifestyle and leisure > leisure > travel and tourism
music music 0.00 -8.57 direct arts, culture, entertainment and media > arts and entertainment > music

← Back to posts

feedtagger 0.1.0-dev model: modernbert-base-zeroshot-v2.0/int8@all-s256 660 posts 0 unclassified min score 0.75