Using a Shell Script to Automate the Building and Deploying of My Hugo Blog

Dec 1, 2023

blot.blog is powered by Hugo, which is static site generator. So basically my blog is a bunch of Markdown and other files that then gets ‘built’ into HTML, CSS, etc. files and then uploaded to the web. But the thing is, this all has to be done manually by command in the Terminal. It’s a pain and adds an extra layer of friction when it comes to blogging. And it also means it’s a huge pain to update the blog via my phone.

So I’ve finally gotten around to automating it via a shell script to reduce this friction. Here’s what it does:

It’s worked well so far. And as the script runs on my always-on Mac mini I can write a post on my phone and all I have to do is add publish to the beginning of the file name to automatically publish it.

Hopefully this will mean I blog a bit more often.

(Here’s the code, if you’re interested)