August 16, 2020

I rebuilt this website.

I know, it looks exactly the same. But underneath it’s all new, I promise.

This is actually version 3 of my website. The first version ran on Jekyll, which was fine, but then it got to the point where I had a couple of years of blog posts and it was taking a really long time to rebuild the site, which slowed me down a bit too much. There was also this feeling nagging at me that I didn’t really understand what was going on underneath. I don’t know Ruby, the language Jekyll is written in, so whenever I wanted to do something out of the ordinary I’d have to hack it together in a language I didn’t really get from whatever information I could find online.

So a couple of years ago I swapped the build for the website to Hugo. I pulled all the content out of the old Jekyll site, smushed it into a Hugo site, smushed my ‘design’ (such as it is) into a Hugo theme, and replaced enough of the Jekyll plugins with existing Hugo plugins or self-written shortcode templates that it basically all worked. Hugo is written in Go, and is much faster at building than Jekyll, so the build speed issue was solved! However I still had the feeling nagging at me that I had no real idea what was going on underneath. Again, I managed to do the things I wanted to do, but it was hacking things together again, and it mostly only worked out of luck. I then had a slightly worse problem, which was that because I only update the website so infrequently, whenever I do come to post an update I’m usually working on a different system on which I’ve never built the website before. Which is fine for most of the build process, but I’d never bothered pinning the version of Hugo, so everytime I rebuilt I’d skip ahead a couple of releases, and find that something had changed and one of my shortcodes was now broken, and it’d take me a couple of days to find the time to sort it out, and by that point I wouldn’t be bothered actually writing the post I’d originally intended to write…

I know. A good workman never blames his tools… but that’s generally how it would go.

And so then we come to now. Or rather, a couple of weeks ago, when I decided I wanted to write a couple of blog posts, and found myself setting up a build environment on yet another laptop, and running into a problem because Hugo didn’t like something and wasn’t building the site right, and I finally ran out of patience and started looking around for an alternative.

The alternative I found is Eleventy. Eleventy is a Static Site Generator just like Jekyll or Hugo, but it’s written in JavaScript. “Aha!” I thought. “A language that I actually know some of. If I use that to build my site I probably still won’t know what’s going on under the hood, but at least I’ll know it’s doing it in a language I’m familiar with!”

So I took the content out of the old Hugo build, smushed it into an Eleventy site, patched together some JavaScript to build the more complicated bits, and voila! A super-fast build process, in JavaScript. Wrapping that in the existing process for building sass, minimising CSS and HTML, sprinkling it all with a little responsive image magic and pushing the result over to Netlify and the site is ready for action once more.

Next: WCP and LEJOG data analysis

Previous: TU Eindhoven Visit