Today, I received a question from a fellow Ruby programmer.
Hey! My friend linked me to your site, and I've enjoyed reading some of the posts on how you are putting your static site together. I was curious: as a fellow rubyist, what drew you to Hugo over some of the ruby options like Jekyll or Middleman?
This blog post sums up my decision to move from Jekyll to Hugo. Below is the salient point:
Jekyll took ~66,000ms to build and serve the website on my machine; That’s 1 minute. Hugo took ~1,500ms; that’s about 1 second.
As I iterated on the design/layout/content, I encountered serious latency with Jekyll. Hugo appealed to me personally and professionally. I opted to port the website build process to Hugo. But that remains only a portion of how “takeonrules.com” gets built.
I use hugo to generate the base HTML, but have several Rake tasks that munge the post build files into a better state. I have not yet extracted the totality into a Git submodule, so this process remains somewhat opaque.
At a high-level, as part of my “publish” task, I have ruby scripts that:
- verify a clean repository
- extract metadata, as seen in https://takeonrules.com/metadata/
- update my blogroll
- extract image metadata (so I can inject that into my JSON+LD data)
- build a slew of redirects (as I migrated from Wordpress to a custom site)
- beautify the HTML (nice pretty nesting in the source)
The result is a bit of a Frankenstein's monster. I use hugo for its blisteringly fast build speeds, and relatively easy data integration. I then use Ruby (nokogiri in particular) to improve on the base site.
Even today, with lots of YAML files in my /data directory (most of which are Burning Wheel RPG lifepaths, and not even rendered in the public version), I have a 3s build time. I would assume in Jekyll it would still take at least a minute.