Quire
Live

Quire

A Go site engine that turns a folder of markdown into a complete website served from a single binary, with plugins for anything live.

GoTemplDatastar

Quire turns a folder of markdown into a complete website: home page, listings, articles, navigation, light and dark themes, a sitemap and share cards. The default look is good enough to ship, and each layer of it can be replaced without touching the others. It's the engine behind the site you're reading, and a few others. It's open source under the MIT licence.

Why

I used to build sites like this with Astro, but I never enjoyed the JavaScript/npm ecosystem. I also wanted dynamic sites (I'm building a Shopify-style art gallery) without writing a client-side SPA in React, Svelte or similar.

So Quire is Go all the way down:

  • A single Go binary serves the whole site
  • Pages are Templ components, which compile to Go
  • Interactivity is Datastar, so there's no JavaScript build step, and state lives on the server rather than being split between back end and front end

The smallest site

A folder of markdown and this:

func main() {
	site := model.Site{Name: "Example", BaseURL: "https://example.com"}
	quire.Run(site, func(e *quire.Engine) error {
		_, err := e.AddCollection(model.Basic{ID: "posts"})
		return err
	})
}

That gives you a home page, a post index, post pages, navigation, light and dark themes, a sitemap and robots.txt, with no templates or CSS of your own.

Quire's own site, a landing page and documentation built with Quire
Quire's own site, a landing page and documentation built with Quire

How it's made

The site's own binary bakes itself with go run . bake: markdown becomes HTML, images become a ladder of WebP widths, and Mermaid diagrams are drawn as SVG by a pure Go renderer. The binary that ships is built without the bake, so production can't convert anything and never spends CPU trying. This site's is 9MB instead of 23MB before its bundle goes in.

one Go binarypages + live patchesactionsTempl pagesenginepluginsbaked pages, images +diagramsbrowser

Wherever I could, I made a mistake in the content stop the site from loading instead of showing up on a page: an unknown frontmatter key, a tag outside the site's vocabulary, an image missing from the bundle. If the site starts, its content is sound.

Anything live, such as a basket, a search box or a comment thread, is a plugin. State lives on the server and changes are pushed to every open tab, with no JavaScript to write on the client.

The documentation covers all of it, and its Design page explains why it is shaped the way it is.