astwerk core

Go-first static sites

astwerk

A static site generator that is just a Go program. Describe the output directory as a tree, call Build, get HTML. No config, no conventions, no client runtime in core.

go get github.com/LukasDerBaum42/astwerk

Get started Documentation Examples

  • Go 1.27+
  • No Node.js
  • No config
  • MIT
the tree is the site
build/ ├── index.html ├── about/ │   └── index.html ├── style/ └── scripts/

Toggle a node — plain JavaScript, no client runtime.

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.

go
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/ when a script carries the wasm build constraint.

Core, in six parts

Everything below is in the main module. Add what a site needs; ignore what it doesn’t.

Static by default

Core astwerk ships no client runtime. A page with no script is HTML and CSS — the same output a hand-written site would have. If a site needs JavaScript, that is a normal <script> tag or a compiled wasm module; both are ordinary files in the tree.

The optional client-side packages — compiled markup, signals, direct DOM access, a browser DOM for tests — live in the separate astwerk-live extension. That side is still in heavy redesign and is very likely to change or be removed; the client-side tools page in the docs is the honest entry point.

Not for you if…

Full comparison against Hugo, Zola, Eleventy and Astro →

Make it yours

The accent switcher is plain JavaScript and CSS variables. Pick a colour and it sticks for the rest of the site.

Accent

indigo — your accent