Christian Kollross

So let's try this out: Hugo

A few years ago I heard about static site generators (SSG), specifically Jekyll. I tried it out, built a simple website, but overall it was a bit too much of a hassle, maybe in part because it was based on Ruby.

A few weeks ago, I heard about Hugo in the german podcast Freak Show. Being written in Go it sounded promising, potentially easier to install. Don’t ask me why, it was just an impression.

So this is me trying out Hugo, hoping it is easy enough for me to write more than just this one article.

My path to getting it to work (for me)

I tried installing it with apt install hugo on Debian 9, but this gave me an extremely outdated version. The first two templates I tried didn’t even get off the ground with this.

I succeeded in installing the current version (I think) with snap install hugo --classic. Note: This version only has access to the user’s home directory.

The integrated server that can be launched with hugo server is nice for writing texts and trying out stuff. To serve the content to the public, the public directory has to be copied over to the server’s directory, in my case Apache. I simplified this process by creating a simple Makefile that will:

  • launch the build process with hugo
  • delete the site’s directory in the webroot
  • copy over the generated static site.
deploy :
	rm -rf public
	hugo
	rm -rf /var/www/mysite
	cp -r public /var/www/mysite

So now I can start writing, trying out other layouts, … Let’s see how this comes along…