Leaving Wordpress for Hakyll

  • ~2 min read

So it’s been a while. I haven’t written here in almost a year. A mixture of being really busy with final year school stuff, an internship as well as barriers to writing (WordPress) effectively ensured I stayed away.

WordPress As A Barrier

WordPress is great for what it is and nowadays you can build just about anything with it, but for how I think, its work flow presented a problem. It seems silly, but having to sign in, type inside a rather crummy editor (compared to what I’m used to), and press buttons was a big hurdle to jump for me. It always put me off from writing, just that little bit of unpleasantness that would stop me from starting. As I said, kind of silly, but thems the rubs.

I’m at a terminal or inside Vim most of the time. If I could publish and control my website without leaving these environments I would be much more likely to keep up with blogging. So that’s what I wanted.

There are tools such as blogpost and WP-CLI, which would provide most of what I was looking for. But even if I could gloss over the interface with some command line tools, it would still come down to managing a collection of plugins and updates that you really ought to stay on top of for security reasons.

So it’s still a bit of a hassle to maintain a WordPress installation even if I could do most of it from the command line. I wanted something simpler, where I could just write, publish and get on with life; no managing a database or being bugged about updates.

Hakyll As An Enabler

Given I didn’t really want to deal with a dynamic blog engine, I was looking for a static site generator. These have been rising in popularity the past few years with things like Jekyll and hosting on Github pages. They are much more suited to my mindset.

There are a some good ones out there, but for a variety of reasons I chose Hakyll. This was mostly because I’m interested in Haskell (the language Hakyll is written in) and powering my website with it seemed like a good way to sharpen my skills. It also uses pandoc which is great and provides a lot of flexibility for input formats.

So now when I get the inspiration to write a post I can just pop open a new buffer, write some stuff, preview the output locally and push it to the server whenever I feel it’s ready. My content, all of it, is with me on my computer at all times. I can write and tweak things without an internet connection and just push everything out when I do. The same could be said with an local development environment once it is set up, but that’s the point, there is little to set up. Once Hakyll is installed you can just work. No databases, or server to have running (well Hakyll uses the Snap server for previewing, but it’s not always running, it starts when you need it and shuts down when you don’t).

It is also very nice to not have to worry about constant security updates. The attack surface for a static site is, in practical terms, nonexistent. Of course, you do give up a few things, like built-in search and comments, but client-side/third-party solutions can provide reasonable replacements.

I’m not going to get into that now as this post is just a bit about why I moved away from WordPress, but I’ve been happy with the switch so far. I intend to do a more technical post exploring the how of switching over and the way things are set up soon.