An introduction to Hugo, a static site generator
A good blogging platform
What makes a good blogging platform really good? Well, that depends on the blogger. Programmers would need different features than make-up bloggers. As a programmer, I need to be able to easily integrate pieces of code with syntax highlighting in my posts and I’d prefer writing them in my favourite text/code editor instead of in a WYSIWYG editor.
A static site generator like Jekyll fulfils (almost) all my needs as a programmer/blogger:
- posts are written in Markdown, Textile, HTML…
- you don’t need to setup a database and any simple web server will do the job since all you have to host is a simple, static website
- once setup, you don’t need to think about updates etc.
- extremely developer friendly (e.g. publish a post using the command line) and open source
- works great with source code control
However, after a while, you start to notice the little things that make Jekyll a lot less simple than it looks like.
- it’s written in Ruby and some of its dependencies aren’t (bug free) available on
- setting it up can be quite bothersome, again, especially on Windows
A few other static site generators have sprung up since Jekyll’s success.
The one that caught my attention was Hugo. It has all the goodness from Jekyll, but it’s way easier to setup. Hugo itself is written in Go, but they build executable binaries for a lot of platforms and architectures. So you don’t need to install anything else. Even compiling it yourself isn’t that hard.
The process of creating a new website is very similar to Jekyll. The
hugo command literally explains itself (
hugo help) and the documentation on its website should suffice for most users.
The other dynamic part of an ordinary blog is the comment section. Again, the easiest way to fix this is relying on a 3rd party comments plugin like Disqus.
Still, these two disadvantages are easily outweighed by the advantages of a static website. Your website will survive slashdotting and the only required maintenance is literally making sure your web server stays online.
In case you have any further questions, remarks or suggestions about this post, feel free to drop me a tweet or an email! You can also find me on Slack on the Xamarin Chat. I go by the username sam_d.
About the author
Sam is a C# developer who builds mobile (cross platform) apps with Xamarin. He's been a certified Xamarin mobile developer since 2016. Sam likes to experiment with all kinds of programming languages and software frameworks. More info