Build your own SSG

My site is back up again, as I'm sure you've noticed. I've had something in this space (acdw.net) since 2017, and was blogging even before that, and in that time I've changed platforms/generators about a half-dozen times. I've used the basics, like Jekyll and WordPress. I've used more flexible ones like Hakyll. I've written my own a few times, using Makefiles and shell scripts.

This time, I think I've got it right, or just about. What I'm about to tell you is going to seem somewhat complicated, but it's the result of working around my very specific constraints, namely

I have a Fastmail account for mail, which comes with 10 GB of storage space. The really great feature about that space is that, if you set up your DNS correctly, you can host files that are open to the Internet, so it's a great target for SSG-built sites.

However, most of the common generators just build the sites, and deploying is another step that requires either ssh access to a server, or being able to commit to a git repository somewhere. I didn't want to have to use the command line, either, again because of work. I don't want to worry about installing all sorts of extra (portable-ized) stuff and having it lay around for IT to find someday when they're doing a routine check of something. Maybe I'm being paranoid. That's not what this is about.

Anyway, to make a long story short (this isn't even the brunt of the article), I have a folder on Fastmail that I can upload my site to, old-school-style, with FTP or by using the drag-and-drop interface on Fastmail's website or app. I used this for a day or two, too — just updating files when I needed to update a page, writing everything in HTML. It was great.

I don't mind writing HTML, so I don't need any markdown/pandoc/kramdown/common/whatever to write instead. However, updating common elements, like the footers here, quickly became tiring. So I thought and thought and figured out a sort of complex system:

  1. I write and upload files (in a slightly-modified HTML for my own ease) to input/ on Fastmail.
  2. Every day, my server pulls those files off Fastmail and minimally processes them (mostly runs them through a little awk, you know) and copies them to an output folder. It also backs up the old folder and does some other stuff.
  3. After creating the output on itself, my server uploads the files in that folder to output/ on Fastmail, which is where https://www.acdw.net points.

Easy!

record scratch

I'm going to be honest. I didn't quite realize until writing this out how ridiculous my setup is. It's a Goldbergian mess of shell, proprietary hosting, another (and by all estimations useless) server, and FTP. What I'm doing could more easily and probably more safely using Github or Gitlab Actions, or whatever you call them. Honestly, maybe I should ...

But this setup is mine. I made it myself, and like a child's scribble, I'm hanging it on the fridge.

Here's the thing about static site generators: at the bottom of it all, they're fancy cp. You map inputs to outputs and transfer those outputs to the Web. It's not complicated.

And I could never get quite happy with the way other generators organized things. I just wanted to make a little thing that was mine, that worked how I wanted it, and that was easy to figure out. And that's what I have.

all of this to say

If you use Jekyll or Eleventy or whatever, good for you! Hell, even WordPress has its uses (it runs like, 30% of the Internet, after all). But consider writing your own static site generator. It's a fun little exercise.