Static sites, no magic
astwerk
A minimal, no-magic static site generator for Go + templ. No Node.js, no JS build tooling. Interactivity via compiled markup — or Go → WASM when you need the whole language.
go get github.com/LukasDerBaum42/astwerkBuild a site Quick reference See it running
- Go 1.25+
- No Node.js
- Zero config
- MIT
build/ ├── index.html ├── about/ │ └── index.html ├── style/ └── scripts/
Live — compiled markup, no WASM. Toggle a node and the output changes.
Design law
Abstract only the repeating boilerplate. If a project needs something the tree can’t express, it falls back to plain Go — never a wall it can’t get past.
The whole mechanism
You describe the output directory as a tree of Nodes and call Build. There is no config file, no convention scanner, no code generation. That is the entire API surface for generating a site.
root := ssg.Node{
Title: "My Site",
Page: ssg.Templ(views.Home),
Children: map[string]ssg.Node{
"docs": {Title: "Docs", Generate: docPages},
"style": {CopyFrom: "style"},
"scripts": {CompileFrom: "scripts"},
},
}
if err := ssg.Build(root, ssg.BuildOptions{Dev: dev}); err != nil {
log.Fatal(err)
}That writes build/index.html, build/docs/index.html, copies style/ in, and compiles scripts/ to WebAssembly.
What you get
The tree walker ssg
One function replaces hand-written page loops and scattered os.MkdirAll calls. Pages get their own path and locale handed to them.
Markdown content content
TOML front matter decoded into your own struct. Point Generate at a directory and get one page per file.
Derived locales BuildLocales
A locale subtree is generated from the base tree. You list only the pages that genuinely differ.
Compiled markup x
Markers generate both the HTML and the JavaScript for a page at build time — no WASM, no framework, and static without JavaScript.
Go in the browser wasmwrap
syscall/js made to feel like Go: query, style, events, fetch and canvas, with chainable calls.
Reactive UI (WASM) reactive
Signals with automatic dependency tracking, fine-grained DOM bindings, keyed lists and a router — the full-Go path.
Starter templates starter
Seventeen copyable .templ files — layouts, collections, SEO, RSS, and the x widgets. Copied, never imported.
Not for you if…
- You want a config file. Go struct literals are the configuration.
- You want conventions to discover your content. You write the tree.
- You want a virtual DOM. Bindings patch one property at a time.
- You want a themes ecosystem. There is a folder of files you copy and edit.
Make it yours
This accent switcher is live, and it is built with astwerk's own x package — the buttons are compiled markup, not a hand-written script. Pick a colour and it sticks for the rest of the site.