New site - new ambitions

Over the course of the last few weekends I finally took the time to revive this blog. In the process I've scraped the old Hugo based site and redone it entirely in metalsmith.

This post tries to shed some background on the reasons (spoiler: personal preferences), how metalsmith is set up for this page and what I'm planning to publish going forward.

A bit of history

When I first registered this domain, it was mostly to reserve it for the future. I was too lazy to actually set up anything spectacular (even though I was working as a web developer during this time). The domain was pointed towards an about.me page, which was the simplest solution at the time. It allowed me to say a few words about myself, and host a CV in the form of a PDF.

However, gradually I've become more interested in actually hosting a technical blog and started to look into possible options. At work I was building mostly sites using WordPress which could have worked well at the time, but would required a whole hosting solution (including support for PHP). I was aware of Github pages at the time, and given that there was no need to update the Blog by non-technical people, I've decided to go down the route of a static site generator.

Go Hugo go!

Enter Hugo. While I hadn't written anything serious in Go at that time (and haven't since), it was the (new?) cool kid on the block and how could I not give it try? Looking back, it was a bad fit from the beginning. It's main selling point - The world’s fastest framework for building websites - is great if you're having a site big enough to run into this problem (I definitely didn't).

Hugo
The world’s fastest framework for building websites

gohugo.io

There are many existing themes for Hugo, but being a web developer at that time, I obviously wanted to write my own. My unfamiliarity of Go templates, as well as Hugo's complex template hierarchy made this a frustrating experience. Don't get me wrong, I still think Hugo is a great tool if you're running a static site at scale (and maybe if you're a Go developer).

I made it work in the end and was able to publish a static page to Github. But I was never fully happy with the result. If memory serves right, it was shortly after that I found a new job, moved to a different country and never found the time nor motivation to continue working or publishing to the blog.

Static site generation as a library

Fast forward a few years. When 2020 Covid pandemic started, I suddenly had more time on my hand. Stuck at home, I've started to rekindle with the idea of having a blog. At the same time I've learned about the Hakyll project. While the name is a homage to the famous Jekyll generator, it utilizes a completely different approach to static site generation.

Most static site generators (SSG) have a predefined set of features which are controlled via a configuration file. Hakyll on the contrary is a library of different functions and modules, which let you write your own static site generator. This sounds complicated at first, but in most cases is rather simple (check out some of their examples). The main benefit of this approach is that it allows you to easily customize your build process and add features to your site, which are not yet present in other, pre-defined SSGs.

While I liked the idea of constructing the build of my site as a composition of different library components, Hakyll is written in Haskell, which I'm not too familiar with. My attempts to build something similar in F# did unfortunately not turn out to be successful (yet :)). Once the lockdown was lifted, I moved into a new role at work and - yet again - forgot about the idea of reviving my blog.

Starting from scratch using metalsmith

Over the last few weekends, I sat down and started from scratch. In order to customize the build process, I've used the minimal, but extendable Metalsmith library. It has a similar approach to Hakyll but is written in JavaScript, which I'm more familiar with, given my day-to-day work. While there were a few hick ups here and there - which I'll write in the future in more detail about - it was mostly smooth sailing. The biggest issue at the moment is a somewhat broken live reload in the browser, which works most of the time.