Switching to a static website

Posted on Sat 21 September 2019 in misc

After over 12 years of using WordPress, I got tired of keeping up-to-date with all the patches. Wordpress itself was fairly easy to keep up-to-date thanks to the auto-updater. But it doesn't stop there: PHP, MySQL, Apache, ...

So I reconsidered what I used my blog for. It's mostly a way for me to document my experiments, hoping that the information would be useful for someone. Often, that someone is me, a few years down the line. While I did appreciate some useful comments now and then, the fight against comment-spam was tiring as well. So I'm not too sad that I'd loose that functionality.

Which brings me to picking a static site generator. Unlike the "dynamic" CMSes, there are a lot more players in the "static site generation" market. I explored different scenario's:

At first, I wanted to import the entire archive of my WordPress blog into the new tool. That turns out to be close to impossible. There are tools that claim to do so, but it never worked out: Images being linked to the wrong URL, layout shifting all around, ...

I was about to admit defeat when I discovered the 404to302 idea. The idea is as simple as it is briliant: modify the webserver to convert a 404 (File not found) into a 302 (redirect) to the previous version of the site. This way, you no longer need to import all previous content, but all old (perma)links simply keep on working (albeit with an additional redirect step)! This removed one big item from my requirement list: being able to import the previous content.

I ended up picking Pelican. It's slightly less popular compared to Jekyll and Hugo, but it's written in a language that I have experience in: Python. I initially tried to get Jekyll to work, but failed to get all required Gems installed on my system.