Moving to Hugo

Tue, Dec 27, 2016

For the last couple weeks I’ve been porting my old blogger blogs over to hugo, resulting in this site. This has mostly consisted of building a theme from scratch. It’s been a fun side project learning Hugo and the Go templating libraries that it uses. It’s also been a chance to dust off some rusty CSS skills.

I’m finally to the point where I feel like I have my theme functional and reasonably responsive. So it’s time to go ahead and push the new site to my just.plain.cool domain and start generating new content.

Once I get my theme at least minimally documented I’ll move it from my private repo to a public one on github.

Why Hugo?

I like the idea of publishing static content. The idea is that you manage your content in some set of input files, add some config and some tranformation templates and spit out a static website. This makes your site portable and extremely easy to publish - no need for databases or complicated web applications to be configured and maintained. Also, it allows the content to be maintained in files… I much prefer a text editor like vim, emacs, or notepad++ to some WYSIWYG web-based editor that asserts its own ideas about what I’ve just typed.

Me and static website generation go way back. Years ago at work I developed and maintained a site using docbook, which is an XML schema for technical documentation. The tranformation was managed by XSLT templates and was pretty slow and painful. Ultimately though, I think docbook is too rigorous and can actually discourage documentation.

I’d played with Jekyll about a year ago. I even started working on a custom theme for it. However, after stepping away for a few months everytime I went back I was frustrated by navigating upgrades to the ruby environment that it required. I’m not a ruby guy, so managing a ruby dev environment just wasn’t appealing. In early Dec. I was wading back into Jekyll when a buddy asked me if I’d see Hugo. I hadn’t, so I starting reading up.

So here I am several weeks later with a custom Hugo template and a good feeling about the work I’ve put into the system. I like Hugo because:

  • statically compiled Go (no dev environment to maintain)
  • handles Markdown input (the export of my blogger blogs to md went right in)
  • wicked fast
  • has basic content types (sections)
  • supports taxonomies
  • the templating system has enough functionality for my needs
  • Hugo’s documentation is helpful
  • Hugo’s forums are helpful and seem pretty active

Tip: if you’re going to develop your own templates, I highly recommend referencing the godocs for hugolib.