September 18th, 2024

Zine: A Static Site Generator Written in Zig

Loris Cro developed Zine, a static site generator in Zig, featuring unique file formats for content management, dynamic asset handling, and comparable performance to Hugo, currently in alpha for simple sites.

Read original articleLink Icon
Zine: A Static Site Generator Written in Zig

Loris Cro has developed Zine, a static site generator (SSG) written in Zig, aimed at enhancing the authoring experience for static websites. Cro's motivation for creating Zine stemmed from his extensive experience with various SSGs, which left him wanting features that were not available in existing tools. Zine introduces unique file formats, including SuperHTML and SuperMD, designed to improve content authoring. SuperHTML allows for valid HTML templates with scripted attributes, enabling better error detection and autoformatting. SuperMD, a Markdown-like format, eliminates inline HTML and supports directives for links, images, and videos, enhancing content management. Zine also integrates with the Zig build system for asset management, allowing for dynamic asset installation rather than static copying. Although Zine is still in its alpha stage, it is functional enough for simple to medium complexity static sites. Cro emphasizes that Zine is not just a faster version of existing SSGs but aims to innovate and improve upon established ideas. The performance of Zine is comparable to Hugo, with instant rebuilds and no prior optimization work. The official website offers documentation and resources for users interested in exploring Zine further.

- Zine is a static site generator created in Zig, focusing on improving the authoring experience.

- It features unique file formats like SuperHTML and SuperMD for better content management.

- The asset system in Zine integrates with the Zig build system for dynamic asset handling.

- Zine is currently in alpha but supports simple to medium complexity static sites.

- Performance is comparable to existing SSGs like Hugo, with instant rebuild capabilities.

Link Icon 5 comments
By @22c - 4 months
Interesting project..

> The most prominent feature of Zine is that every file format it uses has been created from scratch in order to handcraft the content authoring experience.

Sadly, this part is more of a detractor for me. Using generic templating languages, markup languages, etc. means that I'm not locking my content in to the only SSG that supports SuperHTML, SuperMD, Ziggy etc.

I appreciate the enthusiasm and open sourcing this for others to learn from, good luck with the project!

By @tristan957 - 4 months
The most interesting part of this project to me is that the templating is valid html. What bothers me about Hugo is that there is no language server that works well with it, at least that I know of. This might be interesting to experiment with.
By @sionisrecur - 4 months
Reusing the markdown link syntax is interesting. I wonder if it can be extended to allow for extra attributes, for example srcset. The parenthesis make it look like a function so maybe adding more arguments, something like:

    []($image.buildAsset('icon32.png'), {$image.buildAsset('icon64.png'), '2x'})
By @a-french-anon - 4 months
Fun thing, I finished something quite similar in a week: https://git.sr.ht/~q3cpma/make-website ; down to the page language using the macro DSL of https://github.com/ruricolist/spinneret via runtime compilation of the (compile nil (lambda () ...)) kind. It's just HTML, other than that.

Obviously very tailor-made for my website (https://world-playground-deceit.net/) but I plan on improving that part once I'm fully satisfied with it.

By @smusamashah - 4 months
This looks so nice. My site is currently Hugo but I can not stand its syntax. Its painful. I am not a Rust or Go or whatever templating language its using guy. I have been thinking of updating my site, but I feel stuck.

Zine looks super simple to understand and follow on the other hand.