Jordan Streete

A Lesson in Simplicity - Automating Building a Static Site

May, 2025

I, admittedly, am not great at scoping and thinking ahead for my personal projects. Sometimes I get really into it and I get inspired and I charge headfirst into it without completely thinking things through. It’s something I’m actively working to change, but for now that’s who I am.

That also extends to this site, which is a project all on its own. I created the site and the template for how I wanted all my posts to look, and I enthusicastically began adding posts and projects for the world to see (albeit, infrequently). However, what happens when I want to change the template? Now I have to go through each HTML file (I was just writing in raw HTML when I started, for whatever reason), apply the change(s), and verify it’s all correct. This, to put it simply, was a hassle, idiotic, and a bit of a waste of time. So, things here ended up being inconsistent from page-to-page as I got lazier and lazier in maintaining things.

Around last christmas, I decided enough was enough and that I’d fix things.

I initially wanted to use this static-site generator called Soupault (which I still think is quite cool, by the way), but I could never get the config to work properly. Jekyll seemed like too easy a way out, so I didn’t even consider it.

Right around here, the engineer gremin in my head started whispering to me:

“Build your own static site generator, how hard can it be?”

And like an idiot, I listened. This took me on a long and winding path where I built a solid portion of the SSG (which I called jsgen), but at a certain point I couldn’t figure out the relative file paths. I realize this is a stupid bit to get stuck at, but I seriously couldn’t wrap my mind around it. This was especially stupid because what I really wanted out of this project was a way to:

  1.  Convert markdown to html

  2.  Insert it in between some specified HTML tags

  3.  Start a localhost server to check that everything on the site looks good

And I managed to completely overcomplicate it with all this other crap. So, I put the project down for a while, and moved onto the LC-3 VM, which seemed like a much more fun and attractive project at the time. 

Fast forward to about a month later, I’m reading some hacker news comments when I come upon this:

Wait… you can do that?

I quickly wrote a script in bash, and used the python http.server module to start the local server, and within about an hour I had a SSG that solved literally all of my problems.

That is all to say, sometimes it’s best to just take the simple path. There’s no reason to make things complicated, especially when you keep your goals in mind. My goal was to efficiently generate my site so it could actually look good - NOT to create a whole framework to mess around with files and explore weird areas in zig. Keep that in mind and your projects shouldn’t get too out of hand.

The current iteration of buildsite.sh is here on GitHub Gists:

The next step is to only convert files that have recently been changed, something I can do with git status --porcelain, if I remember correctly.

If you want to see jsgen (please don’t), I’ve archived the repo but it’s still readable: jsgen

Have a good day!