Going Hugo

Once upon a time, this blog was a WordPress blog. I like WordPress. I like it a lot. It’s a pretty cool piece of software that has a huge community behind it. It’s really easy to set up and use, and making plugins and templates is a breeze (once you get used to it).

But now, this site is built by Hugo - a static site generator created in Go.

So why switch?

I switched for a couple of reasons. First and foremost was to force myself to learn something new. Static site generators are becoming more and more popular, so I wanted to see what all the fuss was about.

I’d heard about a few before: Statamic (PHP), Metalsmith (NodeJS), and perhaps the most popular, Jekyll (Ruby). While researching my options, I’d stumbled upon Hugo. Something about it struck a chord with me, and I’m still not sure why. It’s a young platform written in a language I’ve never used and barely even looked at. I think that’s what intrigued me so; I’d be throwing myself into the deep end, so to speak.

I have a few blogs I want to convert away from WordPress, so I vowed to do this one in Hugo, and the next will be in Metalsmith. Expect a post in the future where I compare and contrast using them.

Seems like a lot of work…

It might be. Maybe I’ll get frustrated and keep WordPress for my blogs. That’s what learning experiences like this are all about. It could be a breeze…who knows? The whole point is to come away from it all having learned something.

But there are some side benefits to switching too, that may or may not be worth it. For one, using a static site will be infinitely lighter than running WordPress. I won’t need a database or do dynamic page generation. Sure, I could set up a cache for WordPress to mitigate that but…a static site generator will alleviate a lot of need for that too. On top of that, I won’t have to worry about site hacks; it’s just gonna be plain HTML, CSS, and a bit of JS. Nice!

And lastly, I’ll get to write all my content in Markdown. Yeah, I could install a plugin in WordPress to give me that ability, but this way, all of my content is a file saved on my system. I can then version all of it in git or pass it around with Dropbox. It just suits my personal blogging workflow a little better.

So, what do you think so far?

So far, so good. This is a pretty simple little blog, and converting it was a piece of cake. Hugo’s templating engine is straightforward, and getting my theme to work was a matter of replacing the <?php wordpress_functions(); ?> with Hugo’s equivalent, for the most part. Since all the HTML and CSS was already done, I had my template converted in a little less than an hour.

Hugo has a built in webserver that watches for changes to content/templates and reloads on the fly (ala Browsersync), making it perfect for reviewing the site before committing and pushing.

I might do a write-up on the conversion process, but Hugo has about 3 dozen themes in the wild. Looking at how the authors solved problems was a good way for me to learn.

Verdict

I can’t speak for bigger or more complex blogs, because this one is pretty simple, but I give Hugo a thumbs-up and will give it another shot in the future. I’m not going to deem it a “WordPress killer1” - a hobby blogger with little coding experience would probably get frustrated with Hugo at this point, but I can see someone building a desktop GUI that will make building a blog with Hugo a snap. Time will tell.

Footnotes

1. I hate the phrase “_____ killer” and feel bad about using it.