Hello World from Hugo!

If you’re reading this, you’re probably viewing a version of my blog generated by Hugo (unless you’re reading this on gemini). If you’re not familiar with Hugo, I can assure you he’s not my smarter twin, who decided to rebuild my personal site for me.

Hugo is a static site generator developed in Go. I personally think it’s great because it’s easy, simple and fast.

Hugo has many other features that make it a solid, static site generator. I won’t cover them here as I wanted to elaborate more on the ones that weighed the heaviest in my decision to migrate away from my Jekyll personal blog.

Easy

Borrowing from its Go heritage, Hugo offers a streamlined, “batteries included” developer experience, with a useful range of tools included in the same binary out-of-the-box. You would expect to find many of these functions on any modern static content generator worth their salt, but Hugo adds a couple of nice touches which I like.

My favourite feature is the hugo deploy command. The site deployment functionality built into Hugo does what it says on the tin basically; it allows you to publish your Hugo site to most of the major blob storage providers rather easily: Google Cloud Storage, Azure Storage and crucially for me, Amazon S3.

The hugo deploy built-in won me over as I was not awfully impressed by my pre-existing publishing process. Previously, uploading new content to sgfault.com involved installing a tool in my system-wide Ruby package registry that I then I point at my Jekyll site to upload my content to a public S3 bucket. The tool is half-written in Java so it requires the JRE as well as the whole Ruby shebang to run. Furthermore, the tool is no longer maintained. It still works and I don’t really mind apps slowing down development if they’re deemed feature-complete, especially if they’re open source, but it’s just not that great on the whole.

Simple

Hugo is readily distributed as a package or as a standalone binary you can install yourself. That’s it, no dependencies required.

On the other hand, Jekyll websites are ultimately Ruby applications so you have to install quite a few things to get going with a somewhat functional website:

That’s a fair amount of moving parts just to build a simple static blog, and you haven’t even deployed the site yet! You’ll want to throw in some nice CI/CD pipeline for the smooth, publish-on-push services like Heroku or Netlify have gotten us all used to, right? Handwriting a bunch of HTML files yourself and gluing them together with some chewing gum and Bash scripts doesn’t sound too bad now, does it?

Fast

Hugo built this blog in about 240 ms on my 6 year-old, i7 laptop processor (less than 200ms on a builds.sr.ht Alpine build), whereas it takes Jekyll an average of 440 ms to achieve the same result. In the grand scheme of things, the difference is negligible, but Hugo is almost twice as fast nonetheless!

Lower build times also contribute to an even more immediate feel to the local editing experience than what I’m used to while live reloading is enabled on the Hugo dev server.

Conclusion

This is the third time I switch content generators for my website. It started with RefineryCMS, which provided too many features for my rather simple needs, at the expense of having more things lodged between me and the content I wanted to write. For my first migration, I decided to stick with the Ruby ecosystem and move over to Jekyll, which was a big improvement in many ways. However, leaner solutions have emerged over time, better suited around my needs. Now feels the right time to migrate again.

Overall, I’m really happy with Hugo. I was able to replatform, restyle and deploy this blog in a couple of days and build a CI/CD pipeline around it, which is something my old website lacked. This has reduced friction in my writing workflow and will encourage me to write more often. I may write a blog in the future explaining how I performed this last migration as it was quite a bit of fun to put it all together.

Artwork by Ashley McNamara

Back to top ↑

Articles from friends and people I find interesting

In praise of qemu

qemu is another in a long line of great software started by Fabrice Bellard. It provides virtual machines for a wide variety of software architectures. Combined with KVM, it forms the foundation of nearly all cloud services, and it runs SourceHut in our self…

via Drew DeVault's blog September 2, 2022

The quick and practical "MSI" hash table

I generally prefer C, so I’m accustomed to building whatever I need on the fly, such as heaps, linked lists, and especially hash tables. Few programs use more than a small subset of a data structure’s features, making their implementation smaller, simp…

via null program August 8, 2022

Migrating Go and Node.js Fargate tasks and Lambda functions to Graviton ARM processors with CDK

Migrating Go and Node.js Fargate tasks and Lambda functions to Graviton ARM processors with CDK I’ve been using AWS’s Graviton ARM processors for personal projects for a while. They’re cheaper, use lower power chips, and might be better for the environment…

via adrianhesketh.com July 27, 2022

Generated by openring