Moving to Hugo from Jekyll

Published on April 17, 2020

I decided to switch this entire blog from jekyll to Hugo, which is the other big player for the static site generators for blogs market. I had been considering this for a while but the real impetus was yesterday when I ran jekyll serve and got an error about a missing I didn’t know how to solve.

I built some confidence up beforehand by reading articles from others who successfully made the switch then jumped into the documentation.

The switch wasn’t too bad but there were some pain points I wasn’t expecting. I felt some of the documentation on Hugo was a bit lacking. There’s a Quick Start guide but it doesn’t cover layouts and templates, and I found a lot of what I needed to know to be pretty spread out. A stray file, which I thought I was supposed to have, meant {{ range .Pages }} was empty for my posts which took a while to figure out.

That said, once I got the hang of it, templating turned out to be really easy and switching my Jekyll Now-based theme to Hugo took much less time than I had anticipated. I prefer text tutorials but caved and watched some of Mike Dane’s Introduction to Hugo, which are embedded throughout the official docs, and can highly recommend them.

Some things I’ve enjoyed with Hugo:

  • Better file layout. In Jekyll I’d have my posts laid out in one directory as With Hugo the date metadata is in the post itself and I categorize it in directories by year so I have 2020/ instead. To me this feels much easier to manage.
  • Auto refresh. Jekyll would automatically watch for file changes, but Hugo goes a step further and refreshes the page for me if I’m in hugo server.
  • More built-in tools. I prefer things to be built-in than using plugins or external tools and more just seems to be built into Hugo. For instance, hugo gen chromastyles --style=igor gave me classes for syntax highlighting (which I could then modify).
  • Built-in deploy to S3. They support other targets too, and not having to rely on external tools like aws-cli and shell scripts is nice.
  • Go templating makes more sense. I’m not sure exactly what it is but, even though I don’t use Go, the templating just seems more robust. I found I didn’t read the docs much after learning the basics, even being new.

The only thing I really wish Hugo would change is their rss template. It’s built into Hugo, which is great, but doesn’t include full post content. If I want to change this I need to make my own rss template that completely replaces the built-in one. This is something I plan to do eventually.

Since I don’t keep the repository for this blog public, I created seperate repo that just has the css and templates. Another (but less likely) todo is turn that into a proper theme.