Hugo Reboot

It’s that time of the year again, the weather is changing and I’m feeling motivated to start working on personal projects. First among those, setting up a better blog to keep track of what I’m working on. To that end, I am giving Hugo, a static site generator a whirl. I ported over a couple of the old entries in my devlog to seed the new one and now we’re off to the races!

At the time of writing this, I am using the Soho Theme as a starting point. I like how the theme looks, but documentation is a bit sparse. To figure out what parameters I can use for various customizations I have been poking around the theme’s example site and just reading it’s source code. It’s been a good exercise in learning a bit about Hugo’s templating system.

Creating content with Hugo has been pretty easy so far. I am using WSL on my windows machine as my test environment. While working on the site, Hugo can run a webserver that will detect when anything changes and dynamically rebuild the website and refresh your browser for you. All you have to do is run hugo server from your website’s root and it will build the website and host it for you at localhost:1313 by default. Once done with my changes, I can stop the webserver and run hugo to generate a production version of the website in the public folder.

To deploy the website to the server I’ve written two scripts that work together in tandem. On my dev machine a deploy.sh script will build the website, tar the results up, scp the results to the VPS, and then invoke script number two on the VPS using ssh -t '<script_name>'. The script on the server simply decompresses the newly received data and replaces the old website with the new data. Now deploying my local changes is simply running a single deploy script and refreshing the page!