Blog Resurrection

A long, long time ago, I started a new project to create a static site generator written in PHP. There were several existing solutions written in Ruby, but since I don't really get on with Ruby and I like making things, I figured it would be fun.

If you're wondering what static site generators are, they're software that creates a website from a set of files or documents. You don't need anything more than the most-basic hosting package to have your own website. There's no scripting, no database, just plain HTML/CSS files. This makes them extremely fast and robust.

Anyway, I named my project Calcine after a short search for words that could mean "baked", since that's another term used for these sort of sites. They take files and "bake" them into a website. I love a good pun, so thought it was a great name!

I tinkered with this project on and off for a few years, and at some point I migrated this very blog to use it (previously having used Phalcon, and before that Kohana – both PHP frameworks), and then I just sort of… didn't post anymore.

Part of the problem was that I needed to be at a computer in order to edit the files and run the build process. I could have solved that using GitHub Actions, but I never got around to it, and my blog sat gathering dust.

At some point, I had the idea to pull the content from a CMS to generate the static site which would give me the best of both worlds; a super-fast site with no scripting or databases to worry about, with the ease of posting and updating that a dynamic system offers. I'd also spent a fair bit of time building custom sites using WordPress1 and Strapi and so had a pretty good idea what such a system would look like.

When I wanted to share my latest ESP32 project with folks, and given the implosion of various social networks, posting it to a site under my own control seemed like the way forward, so I dusted off my code, set up an instance of Strapi, and started to hot glue them together.

It didn't take me long to create the needed Strapi content types and paste in my existing blog posts. Next I refactored my static site generator to support "post providers", defaulting to the existing file-based approach, but allowing for content to be read from an HTTP API. Finally, I added some hooks to the Strapi instance to automatically run the static site's build command whenever a post is published, or a change was made to an already-published post.

After a few config tweaks and rewrite rules in the web server, I was able to access the CMS, update posts and tags, and have the resulting static site updated in a few seconds! Who knows, maybe having this available will inspire me to post a bit more often.


  1. I decided against WordPress for several reasons; It's massively overkill given my simple requirements, it has a reputation for poor security, and recent shenanigans have really put me off. 

Blog Resurrection
Mat Gadd