Switching My Blog to FreeBSD and Hugo

When I first started writing, my blog was hosted for me as a wordpress.com instance. This worked well for a while, however, I wasn’t happy with the flexibility it afforded me at the price points I was interested in paying to host my blog.

Eventually, I moved my blog from wordpress.com onto a DigitalOcean droplet for $5 a month. I still ran Wordpress, but it was the self-hosted version (wordpress.org) running on top of Ubuntu 20.04. This was far more flexible and at a much more agreeable price point.

However, I found myself chafing at all of the themes, plugins, and WYSIWIG-block-editing shmorgasboard that Wordpress gives to content creators. In fact, I still hate the way that my inline code snippets look on my blog posts (and that required plugins to get to that point).

All I want is a simple document format to write in, reasonably nice-looking code snippets, and a text-focused blog theme.

I don’t need (or want) a database, plugins, or user accounts.

Enter Hugo.

Hugo

Hugo is a static site generator that converts posts and pages written in Markdown into a stitched-together static website.

My website is now checked in to a git repo and all it takes is a simple command, hugo, to generate the HTML for distribution on my web server.

In fact, I’ve also committed a script to quickly deploy the website from whatever machine I’m blogging from:

scripts/deploy.sh

#!/usr/bin/env sh
set -x

HOST="blog"
WWW="/usr/local/www/apache24/data/"

if [ -z "$HOST" ]
then
    echo "HOST is not set" && exit 1
fi

if [ -z "$WWW" ]
then
    echo "WWW is not set" && exit 1
fi

rm -rf public
hugo
rsync -vaz --delete public/ $HOST:$WWW

FreeBSD

Speaking of the web server, I did note in the title of this post that I have moved my web server onto FreeBSD!

I have no technical reason for this beyond the fact that I just plain wanted to. Most of my experience is in GNU+Linux-based software distributions, but lately I have been intrigued by FreeBSD and wanted to start learning it. So, I’ve decided to use it as the operating system for my DigitalOcean droplet that hosts my blog.

I’ve only been using it for a few hours at the time of this writing; but I’m happy to report the overall experience is positive. Perhaps more thoughts on FreeBSD at a later date once I’ve gotten more experience.

Bare-bones

Overall, I love how simple this setup is. I’ve been deriving a great amount of satisfication in “decomposing” monolithic software solutions that I used to use and finding simpler ways to accomplish that same task.