- Blog

Bash Hugo

In setting up this new blog software hugo, I needed to scrape together a handful of shell scripts to make my workflow easier. The first one I slung together is

hugo new posts/"$1"

A very simple shim so I don’t have to remember the hugo command or the path to store new posts to. It takes an argument ($1) that is the markdown file for the new post I want to create. I can call it like so: “./”

Now that I have the basis of a new post, I can edit it in markdown until I’m happy, and then call

hugo -d ~/git/

This deploys the hugo generated static content out to my git repo for Then it calls “” as you can see on line 2 there.

cd ~/git/ || exit
git add html/blog/* && git commit -am "new blog post" && git push

This last script is a simple set of git commands (run in the correct path on disk) that results in a push up to which has commit hooks that deploy my new code out to an nginx docker container.