Zola is a very fast static site generator written in Rust with 10k stars on Github. It is faster than Hugo (written in Go) that has 65k stars on Github. But there are more reasons that Zola may become the new world’s most popular Static Site Generator (SSG). In this blog post I will list the things I’ve found to be better about Zola than Hugo and the other way around.
What did Github do?
Let’s start with some history. Static site generators became really popular with the adoption of Jekyll on Github pages. Unfortunately Github decided that they didn’t want to update their Jekyll runners. Also the performance differences between Jekyll and Hugo were very big: A site that would build in 340 ms in Hugo would take over 14 seconds to build in Jekyll (factor 40 wall clock time) as you can read here. Another comparison can be found here.
Jekyll had Liquid, Zola has Tera!
Hugo is world’s most popular SSG, but it is notoriously hard to learn, especially the template language. Jekyll was using Liquid, which was easier to learn. Zola uses Tera, which looks a lot like Liquid (and like Jinja2, Django templates or Twig). This makes it easier to convert a site from Jekyll to Zola than from Jekyll to Hugo.
Is Zola really faster?
Build times are great with Hugo, but they are absolutely mind-blowing with Zola. To prove the claims I had read (here) I converted a (real) site with 50 pages from Hugo to Zola and measured the build times. These are the build times (as measured by the GNU/Linux “time” command):
Hugo
====
real 0m0,178s
user 0m1,897s
sys 0m0,048s
Zola
====
real 0m0,036s
user 0m0,123s
sys 0m0,052s
As you can see I went from 178ms build time to 36ms build time (“real” or “wall clock” time), roughly a factor 4. On the CPU load (“user” and “sys” time combined) the load decreased by roughly a factor 11: from 1945ms to 175ms. This means that users see their sites faster and that the CPU load on the (build) servers is lower.
Where Zola is better than Hugo
- It generates sites faster
- More familiar template language
- It has search capabilities built-in
Where Hugo is better than Zola
- It is more popular, has a bigger community
- It has flexibility in URL schemes and overrides
- Better support for multi-lingual sites
Conclusion
IMHO Zola is a great alternative to Hugo. It is faster, has an easier to learn template language and has a nice search feature built-in. The documentation was good enough for me and the error messages got me up to speed pretty fast. I felt the developer experience was better than it was with Hugo. I fully recommend to give it a try: I feel this is the most promising static site generator there is right now.
Links
- Zola - Your one-stop static site engine
- Tera - A powerful, easy to use template engine for Rust
- simbleau.github.io - Blogging like a rustacean
- dabase.com - Zola SSG review
- david.kolo.ski - Static Site Generation with Zola
- dev.to - How to use Zola the Rust based static site generator
- peterbabic.dev - Setting up an URL prefix in Zola
- brycewray.com - Gems in the rough