The Zine Static Site Generator

The internet of my dreams has three characteristics:

  1. People of any background should be able to publish their work. If I’ve written an important document that I want to share with the world, I should be able to share it. I should be able to share it regardless of my income or current technical know-how. Most people with worthwhile thoughts are not wealthy or professional web developers, and these should not be prerequisites for contributing to the public square.

  2. Content is not centralized on any hosting platform. People should be able to publish their documents without going through some specific social media site, or some specific web hosting service. Your ability to publish should not be dependent on a powerful corporation, but that’s a low bar—it also shouldn’t be dependent on any third party that might cease to be willing/able to host your content. And if your current content is hosted by some third party, you should be able to pack up your content and leave, publishing it elsewhere.

  3. Accessing content should be low-latency. If I click a link to a page, that page should load instantly. If it can’t load instantly, it should load as fast as current technology permits. If technology improves, the page should take advantage of that new technology to load faster.

I care about many other aspects of the internet, too. Data privacy, accessibility for those with impaired hearing, sight, or hands1, the development of positive and healthy discursive communities—there’s a lot that I think the internet needs to get right.

Most of these things that I want from the internet can be accomplished with static sites, each of which is owned and produced by individual people.

Static sites are excellent, if you can get away with one. Sometimes you can’t. By definition, a static site does not allow for back-and-forth transfers of data between the user and a server, aside from a fixed collection of files that are sent to the user on initial page load. Furthermore, a static site will not perform client-side rendering2, where either JavaScript (or WebAssembly + some minimal JS for DOM access) is used to construct the page’s content once the JavaScript/WebAssembly arrives at the user’s computer. If either of those architectural features are required for the content you’d like to make, then you cannot use a static site.3 But if you do not need those architectural features—and I think the vast majority of people do not—a static site will be strictly better for your purposes. Static sites are:

The main downside of static sites is that they have been, historically7, hard to create and maintain. Accessible tools to do so haven’t existed until quite recently! But they do now.

In the last few years there has been an explosion of static site generators, made by passionate open-source contributors, for making personal websites. These are programs which operate on simple templating-and-markup language files written by you, the site designer, to output a static site. Hugo is the most popular, though I’ve also encountered some people who have used Zola or Eleventy. There are many, many others, and they have many, many subtle differences.

I’ve chosen Zine.

During development, Zine builds sites instantly as you edit them, giving you real-time feedback for each change you make. I’ve constructed two sites using Zine, and the site on which you’re currently reading this paragraph is one of them. I’ve found the development process to be fun and enjoyable.8

Zine is low-level. Its templating and markup languages, respectively called SuperHTML and SuperMD, give you fine-grained control over the actual files on your site. I can craft my pages to be as high performance as possible. I would not be able to keep my DOM as small, my CSS selectors as efficient, and my font loading strategy as effective if Zine did not expose these details directly to me. Exposure to those details also enables me to write accessible, semantic HTML.

Zine is also maintainable. Unlike raw HTML, SuperHTML templates let you write your HTML once and duplicate it across many pages, promoting reuse and encapsulation of logic the way that a good programming language does. Furthermore, the writing and programming aspects of web development are kept separate. SuperHTML handles the low-level details of your .html files, and SuperMD handles the actual content you write. You can program the plumbing of your site once, forget about it, and focus on your content afterward.

The creator of Zine, Loris Cro, is someone who shares many of my values for what I’d like the internet to look like. Their description of the problems an average person faces trying to put their content on the web, and why that problem is so important to solve, is pure poetry. I’d like to quote part of it below:

[T]he web doesn’t belong just to software engineers. The more we make the web complex, the more we push normal users into the enclosures that we like to call social networks.

Dont you find it infuriating when lawyers and accountants fail to clarify how their respective domains work, making them unavoidable intermediaries of systems that in theory you should be able to navigate by yourself?

Whenever we fail to make simple things easy in software engineering, and webdev especially, we are failing society in the exact same way.

This is not something that startups or big tech can solve for us, their economic incentives are just too misaligned, so I invite you all to help make the web more accessible, partially as a matter of taking pride in our craft, and partially because the web used to be more interesting when more of it was made by people different from us.

(The choice of where to bold text in the above quote is my own.)

Many other static site generators were clearly informed by a web developers’ worldview. You can feel it in how they present themselves, and in the kinds of assumptions their design decisions make about their users. Take a look at Eleventy, whose landing page states:

Eleventy requires a way to run JavaScript on your computer and we recommend Node.js (version 18 or newer). You can check whether or not you have Node.js installed by running node --version in a Terminal.

They provide a link, for people who don’t know what a terminal is, that explains how to use a CLI. I think it’s great that they provide that link! But the assumption that people are 100% okay with installing Node.js rubs me the wrong way. For every thing you ask people to install to use your program, you place a barrier to entry in front of them. Why was Eleventy designed such that it requires some way to run JavaScript on your computer? Well, to quote another section of the site:

BET ON JAVASCRIPT

Always bet on JavaScript. JavaScript gives you access to npm. The npm ecosystem is large. Crazy large. And it’s only growing in popularity. According to modulecounts.com, npm has almost three times the modules of its second place competitor, Maven Central (Java). When you want to add functionality, it’s a good bet that a module exists on npm.

I don’t want to opt into the npm ecosystem. It’s a necessity if you’re a web developer, but I dream of a world where JavaScript ceases to be a language that we rely on for anything at all.

Some excellent people use Eleventy, and I think it’s a fantastic project. Zach Leatherman, the creator of Eleventy, is someone I deeply respect. His writings on web fonts are some of the most informative educational resources the internet has to offer about the topic. And he fought hard to keep Eleventy up and running during some very dark times.

But which tools I use to make my own personal website is a pretty intimate choice—I’ll be investing time and energy into learning them, for years to come, and they should match my values. Eleventy doesn’t snugly fit into those values. Despite my admiration for its creator, I would feel sad using it. It wouldn’t be right.

Zine has never made me feel this way. It is written in Zig, a language that I think has extraordinary potential to improve the world of systems programming and beyond. Furthermore, because it is written in Zig, Zine has been compiled to a single static binary that I can run on my Windows computer. No installation of anything is required. I don’t even need to add Zine to the PATH if I don’t want to; I can just place it in the directory of my personal website and run it from there. These are staggeringly low barriers to entry.9

Unlike many other static site generators, Zine’s source code has been written without AI contributions. I think many people in the software industry underestimate just how much of a draw that can be.

But Zine isn’t perfect yet. At the time of writing, Zine is still alpha software. It has several rough edges to be polished, and I’d like to help make it better.

I’ve been keeping track of any pain points I’ve experienced with Zine, and written them in an article that I plan to update as they are fixed. For any that seem actionable, I plan to promote them to issues on GitHub.

I would like to contribute to Zine’s development as much as an inexperienced-with-open-source-contributions, time-constrained academic researcher can, and this is the first place I can start.

In choosing Zine, I join others who feel similarly optimistic about the tools Loris is building. Zine is the tool I intend to recommend to others in my social circle who want to make a website for themselves. I’m excited to see this community get bigger, and I’m excited to see the internet get better as it does.