https://blog.hiramiya.me/feed.xml

Choosing an SSG

2024-09-05

Choosing a static site generator can be a challenging task, with lots of options and differences between them being relatively subtle - after all, they're all taking some plain input files and putting out fully generated HTML through some kind of template...

The choices

This is by no means an exhaustive list. Rather, these are some that were considered.

NameLanguageTemplatingNote
JekyllRubyLiquidGitHub pages
HugoGoGo Templates
GatsbyJS/ReactPug/Handlebars/Other(?)
Next.JSJS/ReactOwn via React
EleventyJSMultiple
AstroJSOwn
SvelteKitJSOwn
PelicanPythonJinja2
ZolaRustTera

Jekyll

Noted above, Jekyll powers GitHub Pages, and has a relatively straightforward template structure from Liquid. There's really nothing wrong with Jekyll, and it's very well documented by a suitably large community. It's been around forever.

Hugo

Written in Go, compiles to a single binary, but frankly the Go template syntax is just horrible.

JavaScript options

These don't get a heading each, as I'm largely predisposed against JavaScript being used for anything more than some simple client-side code for basic things on a browser. Using it as a whole standlone thing bothers me, for whatever reason. I was somewhat prepared to be convinced otherwise if a decent enough SSG was on offer, so still took a look.

That said, some honourable mentions here:

Eleventy (horribly named as 11ty) appears well designed and supports such a wide variety of input content - everything from simply copying full HTML files, to processing markdown, and handling Liquid/Mustache/Pug and more other template formats.

SvelteKit, and Svelte itself, are somewhat bearable to work with. Their subtle layer over the top of basic HTML makes it a breeze to create some well-behaving webapps. Unfortunately, SvelteKit has burned me a couple of times when trying to do Server-Side Rendering (SSR) where it didn't entirely behave correctly.

Those things that are in any way related to React? Hard pass.

Pelican

Recommended when asking for opinions on SSGs, Pelican appears to be a rather interesting project. It's written in Python providing for a wide range of extensibility, and relies on the tried-and-true Jinja2 template format. Pelican feels very intended as a blog-first solution, and when originally asking for SSG recommendations a blog was not the intention.. Might still test it one day.

Zola

Found randomly and then also recommended when looking for opinions, Zola is written in Rust and compiled as a single binary. The template engine (Tera) and Zola itself were written out of frustration of Hugo's use of Go templating, and Tera feels a lot more similar to Jinja2. Having a familiar-looking template engine was a big plus, as well as clearly defined uses for both static pages and blog-like formats.

Material for MkDocs

This one isn't in the table, but gets a shoutout here. MkDocs per it's name is designed for creating documentation sites, not static sites (or blogs, really) however the "Material for MkDocs" project does a pretty good job of showing both static non-docs pages, and also a blog! Since the original search wasn't for a blog, this option was initially passed over, but might come back as something to try.

Making the choice

Choosing which to use started out as a bit of a look at the overall landscape. Jekyll was always a safe option, but trying something new sounded fun. Hugo was off the table quickly, as were the JavaScript-based ones. Sorry, that's just how it is.

Pelican and Zola were left as the only choices, and Zola had turned up before having both itself and Pelican recommended. So, Zola won by a hair of being the first one - and it helped finding the theme library and finding a simplistic theme that also looks nice enough (serene, currently powering this very blog)