Sheaf
An open-source static site generator for Elm developers: content is Markdown, templates are typed Elm functions, and the output is plain HTML and CSS with no JavaScript. Its main idea is that mistakes in content should fail the build with a message that points at the line, not ship.
Stack
- CLI
- TypeScript on Bun: fast startup, a built-in test runner, single-file binaries
- Templates
- Elm: one compiler checks templates, frontmatter and links together
- Markdown
- micromark / mdast, GFM + directives: a real syntax tree, and components written in Elm
- Code blocks
- Shiki, at build time: highlighted HTML, so readers download no JavaScript
- Output
- HTML, CSS, RSS, Atom, sitemap: a folder any static host can serve
Shape
content/*.md ─▶ parse (mdast) ─▶ generate Elm modules ─▶ elm make --optimize
│
dist/ ◀─ write HTML, feeds, sitemap, images ◀─ run Elm as a headless workerNotes
How a build works
The CLI parses every Markdown file into a syntax tree, then writes Elm modules for each collection of documents, so templates can refer to a page as a typed value. It compiles the site with Elm’s optimizing compiler and runs the result headless, as a worker that the CLI talks to through ports: the CLI sends a document, Elm sends back HTML.
Around that sit the parts a blog needs: code highlighting, image handling, feeds, a sitemap, and a dev server that rebuilds on save and reloads the browser.
Errors as a feature
Frontmatter is read by decoders the site declares in Elm, so a misspelled field is an error with a suggestion (“did you mean summary?”), shown in the same style as Elm’s compiler messages. Links between documents are checked, as are images and the language of every code block. A stage reports everything it finds before the build stops, so one run shows all the problems.
Where it stands
It is not released yet: the CLI runs from a clone, and the API may change before 1.0. Before writing it I compared it with elm-pages, Elmstatic, Hugo, Zola, Eleventy and Astro, and the README says plainly when one of them is the better choice.