Website Overhaul

For the first time in a really long time, I've overhauled this website. I would class it as the third generation of my personal website, and I thought I would spend a few paragraphs writing about it.

The first iteration of my website was a handwritten, completely from scratch blogging system that my friends and I all used back in the early 2000's whilst at university. I wrote it in PHP and it was a pretty cool system. Unfortunately I've lost all database backups of that time, so whilst I wanted to bring those posts back into this new website, I unfortunately just couldn't find them. The code for the site still exists, but it is not all that fun without the content (at least, for me).

After a while I gave up on that site and let WordPress take over, so from 2006 or so onwards that is what I used up until early 2020. The issue I always had with WordPress was that WordPress feels so heavy and fragile, and a bit of a black box. It required a powerful (and expensive) VM, or a slow and cheap shared host. For the first decade or so, I used Dreamhost, which was fine. More recently, the website was hosted on an Azure VM, which was far more performant, but it meant I spent a couple of hundred dollars a year on my website setup, and I didn't really enjoy paying that bill every year. I also didn't like feeling like my VM was a hack, a crash, a corruption, or an upgrade away from disaster.

Which brings us to where we are today - I've gone back to simplicity. This website is now static, built using my Site Builder tool. It works by reading in a number of files (one xml file per post, as well as the various other pages on the site), and uses a simple templating framework that I built to generate final html files. I've published everything required to build this static site to GitHub, and I've configured Github Actions to trigger on every commit to the repo to re-run Site Builder, and then to upload the updated site to Azure Blob Storage. I use Azure Blob Storage as it has built-in support for static site hosting, and it is incredibly cheap (I believe I'm paying fractions of a cent per month). On top of this, I use Azure CDN to globally distribute the website to servers closer to my audience, and again, this is costing me fractions of a cent per month.

The end result of this is that every time I want to blog, I add an XML file into my GitHub repository, and GitHub Actions will trigger, build the site, and upload it to Azure Blob Storage, overwriting my old site with the new content. I have all the file revision history in place in GitHub, it's all open source, and I really don't feel like I've lost anything from WordPress. I feel like I understand my site a lot better and can integrate functionality into it far easier than I could under WordPress, as I'm not fighting plugins, PHP, and WordPress.

I spent a substantially larger amount of time extracting the data out of WordPress - I've tried to port all content. I spent a lot of time writing tooling that extracts a WordPress dump of posts to create the post files for this website, and an even longer time going through and tidying these files up to fix links, styling, etc. I also ported the pages from my site into the new templating format I created.

One hurdle remained - I had a number of blog posts with a lot of comments on them, and I really didn't want to throw them away. I also really wanted to have a commenting system - even on a static website I needed a solution! Fortunately, I discovered a means to continue to enable post commenting on a static site! As you can see below, post comments are possible because I've integrated utteranc.es into my website. Utteranc.es works by looking into a specified GitHub repository for a comment with a certain title that matches some property of a blog post, and if a match is found, it will display all comments on that GitHub issue. If a GitHub issue does not exist, and a user leaves a comment, an issue will be created and the comment added. Funnily enough, utteranc.es was written by a fellow Microsoft employee, and it works wonderfully. Once I found this, I wrote another tool that extracts all of the comments from my WordPress website and uploads the comments into GitHub, so that utteranc.es can display them on the relevant post.

With the site simplified, I feel a rejuvenated sense towards blogging again. I've been extremely busy these past years at Microsoft, and I feel like I am not doing my civic duty of sharing my learnings with others, so going forward I hope to more actively blog here about topics of interest.

Thoughts on “Website Overhaul”