markjgsmith

Static site generator archives plugin update

2024-06-13 04:57:00 +07:00 by Mark Smith

I got the latest archives plugin, which now supports the everything page, fully working in staging yesterday. It was pretty difficult not only because of string headwinds from a very warpathy world, but also because it was technically quite a challenge. The everything page is built from a dataset created by merging multiple datasets. What this means is that it's no longer so trivial to build the correct urls on each page because the data could be in many different locations depending on which item it is.

One cool thing I was able to improve on the original implementation is to use the regular data source primitive, but modify it so that's where the data merging occurs. I had tried this initially but, for whatever reason, I had hit a wall. Perhaps there was another bug blocking at the time, who knows. In any case I ended up implementing the data merge in another part of the render process. It worked but was a bit clunky. I guess some of the housekeeping and refactoring from the past few weeks must have cleared the path, because when I tried to create a merged data source it all worked wonderfully.

It's nice when that happens. It's a sort of validation that the system's primitives, the basic building blocks that you combine together, are the right shape. It makes things much more clear to understand, rather than have these special cases that get around the fact that the primitives don't provide the needed functionality.

There was still quite a bit of tedious work after that, both removing the special casing, and updating the code to use the merged data. Of course I ran into build minute issues again and, though I was able to really improve the module caching logic, in the end it wasn't enough, and yesterday evening I basically ran out of build minutes again. I think I've still got a few to publish the odd post on the website, but basically actually merging and deploying the new archives plugin will now have to wait until next month when my build minutes reset.

It's so frustrating, you pull out all the stops, physically put your body through lots of pain, battle through tsunami after tsunami from a world constantly on the warpath, only to find you haven't quite got enough resources. And it's made worse by bizare bugs in Github Actions that cause jobs to occasionally get stuck when you aren't looking, wasting precious build minutes.

Anyway, roll on July, looks like it will be a 4th of July release for the completed everything page including archive pages.

For enquiries about my consulting, development, training and writing services, aswell as sponsorship opportunities contact me directly via email. More details about me here.