My very simple blog setup
metaWith the recent descent into AI madness of the Wordpress folks there have been a few people on Mastodon looking for other hosting options, so I figured I’d do a quick “here is how I set up my blog” post.
The short version is that it’s a static site generated with Hugo, hosted on the file sharing space provided by Fastmail to its email customers. This is pretty easy and doesn’t cost me anything more than I was already paying for my email, but might be missing some of the features other people need.
Edit: This page has been updated to reflect my updated posting system using rclone and GitLab CI.
My requirements for a blog were pretty simple – I wanted minimal features (no comments, no interactivity), a full-text RSS feed, cheap to host (but not cheap because someone was selling my data), and the ability to write and post posts from my iPad. If you want/need a content management system, or capacity for multiple authors, or to be able to take comments or whatever this probably won’t work for you.
To keep it pretty brief, here is how it works:
- I generated the site, as per the Hugo Quick Start Guide and added it to a git repo.
- I added a theme as a git submodule to the repo.1
- I create posts and format the front-matter with a custom Drafts action (but it’s easy enough to do that by hand if you prefer).
- I add new posts to the repo, either the old fashioned way or using Working Copy on the iPad, and push those to the repo.
- My git host, GitLab, runs a Continuous Integration (CI) pipeline that runs
hugo
to build the blog and then rclone to push it to Fastmail.2
This last step is the tricky one as Fastmail only supports file uploads through its website or via WebDAV. If you have a server somewhere where you can use rsync or sftp or whatever this step will be much simpler. Rclone seems like a decent solution for WebDAV but it does have some quirks that need to be worked around in your CI pipeline.
The CI pipeline I used is as minimal as I could get away with:
image: registry.gitlab.com/pages/hugo:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
deploy:
timeout: 5 minutes
script:
- apk add rclone
- echo "$RCLONE_CONFIG" >> /etc/rclone.conf
- hugo
- rclone sync --config=/etc/rclone.conf --webdav-pass=$WEBDAV_PASSWORD ./public $WEBDAV_HOST
artifacts:
paths:
- public
only: # Only run on main branch
variables:
- $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
Rclone complains if there is no configuation file available. The easiest way to generate one is by running rclone config
and storing the output in a CI variable. Mine looks like this:
[fastmail]
type = webdav
url = https://myfiles.fastmail.com
vendor = fastmail
user = user@example.com
The last catch is that you need to to obscure your password before rclone will use it, by running echo "password123" | rclone obscure -
and putting the output into another variable (WEBDAV_PASSWORD
, in my case).
I’m sure there are GitHub Actions that work just as well, but I’m more familiar with GitLab CI. This takes about 30 seconds to run so you won’t use up the time quota on the free GitLab tier in any great hurry. This setup means that I can edit and publish pages from anywhere I can access GitLab (including my phone if need be).
I’m pretty happy with Hugo – its defaults are reasonable to get started quickly, there are lots of themes that look nice, and it’s easy enough to add features on (things like full-text RSS feeds). But there are a lot of static site generators out there of various levels of complexity, so pick one that works for you.