I Go to Hugo
Posted on Nov 05, 2017 by Colin
In my never ending quest in search of the perfect static site generator, I think I’ve finally found the perfect one: Hugo. Hugo is a static site generator written in the Go programming language, and since it’s release it’s gained a staggering 231% increase in usage over the last year. The massive increase of popularity over the last year really grabbed my attention, so I decided to try it.
And after giving it a try, this website is obviously running Hugo now as we speak. So far I’ve been blown away with how nice it is. I’ve decided to compile a list of reasons why I believe Hugo is better than Pelican and Jekyll below:
1. Portable code.
As Hugo is written in Go, there is a portable binary that can be run on Windows, macOS, and GNU/Linux. I’m someone who likes to juggle between both GNU/Linux and Windows, so being able to work on my website on all major operating systems is huge to me.
2. Less hacks, more writing.
One of my biggest gripes with Pelican was the fact I had to use quite a few hacks in my custom theme to get what I wanted. I wanted to specify whether or not I wanted a page to appear in the navigation bar in the page’s own Markdown file. Pelican only let you do this in the site’s configuration file, but Hugo lets you do it the way I want to. Here’s an example of a Markdown file for a page:
--- title: "Page title" author: "Mr. Author" menu: main weight: 2 --- Some page content would go in here.
This feature is huge for me, as I can now easily order pages in a navigation menu to my liking, without using really ugly hacks like I had to do in Pelican and Jekyll.
3. Live editing
Pelican has this feature, but Hugo does it better. When running Hugo in server mode (
hugo server), you can edit your content or theme and the changes appear instantly in your browser. No F5 jamming required. :)
4. Awesome templating system
Jinja2, the templating system used in Pelican, is not a bad templating system by any stretch, but Hugo’s just seems more… powerful. It does require that you learn a little Go in the process, but once you’re over that hurdle, making a theme really isn’t that hard.
When making your own theme, it is best to not create your own, and instead fork someone else’s and go from there. The theme mrtux.org uses is a fork of Hugo-Classic, which itself is a fork of eXtremely Minimal.
In conclusion, Hugo is a wonderful static site generator. It does a lot of things really well, and is super fast and easy to get started with. The portability that comes with it being written in Go makes it more accessible to more front-end designers who don’t want to use GNU/Linux or deal with Python or Ruby libraries. Out of all the static site generators I’ve come across of and used, Hugo is by far the easiest to learn and get started with.
Hopefully Hugo will be the beginning of the end of massive content management systems like WordPress. I’m getting kind of tired of seeing that insecure mess of code, after all.