Zine is a fast, scalable, and flexible Static Site Generator (SSG) written in Zig. It is designed for performance and provides a modern development experience with live reloading and advanced templating.
- Language: Zig (Minimum version 0.15.0)
- Markdown Engine: supermd
- HTML Engine: superhtml
- Data Format: ziggy
- Core Architecture:
src/main.zig: Entry point, dispatches CLI subcommands.src/root.zig: Core logic for configuration loading, content scanning, and site building.src/worker.zig: Handles concurrent tasks for scaling.src/cli/: Implementation of subcommands (init,release,debug,serve).src/render/: HTML rendering logic for Markdown content.src/context/: Data models for Site, Page, Assets, etc., available in templates.
- Build Zine:
zig build - Check Build:
zig build check(faster than full build, only checks the executable) - Run Tests:
zig build test(runs snapshot tests intests/) - Run on Test Site:
zig build run(runszineagainst thestandalone-testdirectory)
Once built, you can use the zine executable (found in zig-out/bin/):
- Initialize a new site:
zine init(optionally with--multilingual) - Start dev server:
zine(default command, serves onlocalhost:8000) - Build for release:
zine release(outputs topublic/by default) - Version info:
zine version
- Snapshot Testing: Zine relies heavily on snapshot tests located in
tests/. These tests compare actual output againstsnapshot.txtfiles to prevent regressions. - Strict Typing: Uses Zig's type system extensively to ensure correctness, particularly with
ziggyschemas for configuration and frontmatter. - Performance: Designed to be multi-threaded;
worker.zigmanages parallel processing of pages. - Template System: Uses
superhtmlfor layouts. Templates have access to$site,$page, and custom properties defined in frontmatter.
zine.ziggy: The main configuration file for a Zine project.frontmatter.ziggy-schema: Defines the schema for page metadata.src/root.zig: Contains theSiteandConfigstructs which define the project structure.build.zig: Defines the build process and test runners.