I had been using Pelican to manage this site, but switched it to Hugo this week. My main reason for this is that I want to learn Go and Hugo is written in Go and uses Go templates in themes and a few other places. After having played with it for a few weeks, I thought I’d share my impressions so far.
Pros
Hugo really is fast. In the process of doing this I moved my ancient
home page into here along with all the pictures it contained. It
weighs in at around 340M which I worried would be a bit heavy to
shift around. No, turns out it takes just over a second for hugo
to fully populate the publishDir
. With that speed I’m happy to
blow away the publishDir
and rebuild it without playing games
with soft links.
Themes are pretty easy to understand and were not that hard to work
with. Still not clear on some nuances - mainly due to my confusion
around sections, tags and taxonomies - but I’ve found it easy enough to
get stuff done. I started with the Vienna and have since been
making a lot of changes. As an aside I used git subtree
to
import the theme. It allows me to change it easily (which
git submodule
does not) and I can still import
changes. Though with the level of change I made that might not be useful.
Meta-data for posts is handled by front matter which is
a bit more formal and flexible than pelican’s RFC 822 inspired
headers. It also has a nifty feature called archetypes
which allows you to pre-fill in posts - front matter as well as content.
New posts can be created with hugo new section/title.md
.
Hugo has a default directory structure for the various things it
needs to construct a site. Happily this can be configured since the
default uses config.toml
for configuration and content
for the
pages. I like dirs and files to be unique within two chars, not
four because I’m a lazy typist.
The speed bit has made deployment simple. I merely do a git dist and it’s published. The push to my
webserver triggers a post-receive hook which checks
out the latest version in a GIT_WORK_TREE and then
runs make publish
. All of this takes about 5 seconds with the site
generation barely being over a second of it.
Cons
Hugo has a concept of sections, tags and taxonomies - which can interact with the type of a page among other things. The relations among these things aren’t very clear. At least not to me.
All pages are in the RSS feed. This… is annoying.
Along these lines, pages can have a date and/or a weight. Pages with a weight come first followed by pages with a date. In order to hide pages at the very end of the RSS feed you’ll need to give them an ancient date. It would be nice if you could get posts after dates using the weight param. Or just get them out of RSS generally.
All of the static data in hugo is copied, not hardlinked. That makes it a bit slower. I’ve filed a bug but suspect it will take me time to add it (assuming they accept it). But could be a good “learning Go” project so not all bad really.
Conclusions
So far I’m very happy with hugo. It meets my needs. Both as publishing tool and as a way to learn Go in actual use. The issues mainly revolve around the learning curve. I’ll keep going with it and see if I can either address the issues or learn what I need to know to make them non-issues.