Previously, I had mentioned that I was going to move the blog away from an EC2 hosted instance of WordPress. Whilst this was a positive experience, it wasn’t really what I wanted to spend my time doing. I spent way too much time fiddling and doing BAU maintenance.
- Learning the intricacies of AWS
- Tying myself to the Amazon ecosystem
- Learning how docker and docker-compose works
- Tinkering with Nginx config files
- Making sure that WordPress plugins were up to date
- Generating my own SSL certificates
This was all before I could even write a single post!
Finding a Solution
I looked at a few different solutions and eventually settled with Hugo hosted on Firebase. There were many reasons why I chose this combination, the most important being:
- I wanted a low maintenance solution for a blog where I didn’t have to manage my own infrastructure
- I wanted the cost to stay low, even if readership scaled
- I didn’t need to host any APIs for a simple blog
- I wanted it to be fast
Installation is simple if you are already used to a modern Node.js environment. The Hugo executable can be installed via Chocolatey, and you are good to go.
choco install hugo -confirm
Hugo works by taking your raw site files, and compiling everything to a directory which should be uploaded in full to a publically accessible web server. It’s highly flexible in that your raw files can be in a variety of formats, including json, yaml and toml.
Hugo also comes with a huge library of themes from the community, which are free to use and easily customisable. You can link to a theme using git submodules to always keep up with the latest fixes. Themes are broken down into building blocks called partials - you can override parts of the theme by creating your own partials. It almost reminds me of the 2000s when PHP was popular and you could do includes of other files.
Your content is also simpler to maintain. Each post is just a text file with some metadata and tags which instruct Hugo to do things like add links and insert images, like a cross between LaTeX and HTML. A great advantage is that all the raw text files can be committed to Git. No more painful backup scheduling and complex restore mechanisms!
Firebase is Google’s new way of doing things. Whilst GCP is still available, Firebase is a set of easy to install tools that allow you to quickly spin up the resources most commonly needed to create an app. There’s User Authentication, Realtime Databases, Serverless Functions, and most importantly for me: Hosting.
Firebase hosting is fantastic in how simple it is. It’s designed for speed in mind. Whilst it is possible now to host a Node.js site on Firebase by using Hosting and Functions, it’s bread and butter is serving static content over SSL secured content over it’s CDN. No more need to generate your own LetsEncrypt certificates! Simply set up your project directory, generate your public content, and deploy to the cloud.
hugo && firebase deploy
The Future of (my) Blogging
I’m glad I made the switch from WordPress. Using Hugo for blogging is much easier as a developer. I don’t have to constantly monitor my remaining EC2 compute hours, and hosting on Google’s Spark plan is literally free. Site delivery is faster than ever, and backups are handled by my Git repo. So far I am a happy blogger.