4
Example content records still backing the project copy
Wren, Zig, HTML IR, WASM
Official Project Site
mola-sitegen-wren is a focused example project. It shows how a Zig host can expose mola-sitegen1 HTML IR to Wren for static generation, then reuse Zig again in the browser through WebAssembly.
What ships
Wren and Zig build the landing pages into dist/.
The Hacker News section and demo form run through app.wasm.
JavaScript only attaches browser events, fetch, and DOM updates.
Example content records still backing the project copy
Top-level pages in the new information architecture
Browser-side WASM runtime
Shared HTML IR model across build time and runtime
Why this exists
The point of this repository is to show an understandable composition of mola-sitegen1, mola-wren, Zig, and WebAssembly. The site should feel like an official project surface for that stack, not like a random UI kit.
Pages ship as normal HTML files and work without a server runtime.
Only the demo page hydrates live behavior through WASM.
Both static and dynamic rendering use the same Zig HTML IR.
Useful snippet
Code example
The top-level Wren file still owns the static site map.
import "sitegen" for Site
import "pages" for Pages
Site.asset("assets/app.js", "assets/app.js")
Site.asset("zig-out/wasm/app.wasm", "assets/app.wasm")
Site.page("/", "mola-sitegen-wren", "Official project site.", Pages.home(posts))
Site.page("/architecture/index.html", "Architecture", "How the project is put together.", Pages.architecture(posts))
Site.page("/demo/index.html", "Demo", "Live Zig/WASM demos.", Pages.demo(posts))
Site.build("dist")Stack overview
Defines the HTML IR, rendering, and asset/page emission.
Embeds Wren and exposes the foreign boundary into Zig.
Authors the pages, layout, and content-level structure.
Runs the interactive demo logic in the browser.