Been neglecting this blog for a while (check: blog cliché), but just migrated across from Pelican to Hugo, so thought this warrants a quick “check this out” post…
Hugo?
There’s a bit of a buzz around Hugo in the (albeit niche) world of static-blog-generation-tools. Though Pelican has been great, it feels like the world is slowly moving on from python.
Or maybe I’m just a sucker for new stuff. :-)
Hugo is easy to install, fast, well documented and supports live reload in browser. I didn’t get how useful live reload would be until using it. Even with simple markdown formatting it’s really useful for previewing and proof-reading content.
Hugo in usage also feels much like golang - simple, approachable, matter-of-factness to how it works with the same joie de vivre. And Hugo really is fast.
The other motivation is to move the blog generation itself onto hosted services: git (Bitbucket) -> CI (Codeship) -> Hosting (S3). I’ll blog about this soon too.
Migrating
The content by and large could be copied as is to under the content directory
in a hugo new site
, with slight rearrangement into subdirs to reflect hugo
sections (which best corresponded to pelican’s categories).
To maintain the same url structure I ended up hardcoding url = ‘…’ into the frontmatter. A bit ugly until I figure out redirects or just drop the old structure.
The grunt work was: perl -pi -e 's/.../.../g'
massaging the
frontmatter (content headers) to hugo’s variables.
Hugo has a good set of existing themes, I wanted to keep the ‘smashing- magazine’ theme, which took the rest of the time. Familiarity with golang templates helps, but this theme is just 8 .html templates and the assets copied across without needing to be touched.
Disqus integration was straightforward, and by maintaining the url structure all the existing comments have came across as is.