Fabricate is a Clojure library, categorized as a developer tool, that generates static websites by evaluating Clojure code to produce page content.
What is Fabricate?
Fabricate is a Clojure library for making static websites, using Clojure as the page-generation language. It takes templates containing Clojure expressions and raw Clojure files as sources, and produces static HTML pages via a three-function API: plan!, assemble, and construct!. The library is built around the idea that you should be able to use Clojure to generate as much or as little of your website as necessary, and it runs on any JVM environment that supports Clojure.
What makes Fabricate stand out?
- Clojure-powered generation — Evaluate Clojure code to generate page contents, giving you programmatic control over every part of the site.
- Core API with three functions —
plan!collects sources,assemblebuilds documents from sources, andconstruct!generates pages, all with a simple threading API. - Multimethod extensibility — Three multimethods —
collect,build, andproduce!— correspond to the three API functions, allowing extension to new markup formats. - Two built-in source types — Generate page data from templates containing Clojure expressions and from Clojure files; markdown support is planned.
- Stable core API — The
site.fabricate.apinamespace is stable, with prototype-prefixed namespaces still subject to change. - Kindly protocol compatibility planned — Future support for the emerging kindly protocol will allow flexible display of Clojure values.
- Static HTML output — Produces static pages that can be hosted anywhere without a server runtime.
Who is Fabricate for?
- Clojure developers — who want to build websites in the same language they use for application logic, without learning a separate templating language.
- Static site authors — who need data-driven or computed page content, such as generated documentation or reports, rather than hand-written HTML.
- Developers mixing content formats — who use Clerk for some pages and markdown for others and want a unified API to assemble them into one site.
What can you do with Fabricate?
- Generate documentation sites — Write Clojure expressions that compute API references, examples, and narrative pages from a single data source.
- Build data-driven pages — Compute tables, charts, or listings in Clojure and render them directly as HTML without a templating step.
- Prototype sites in a REPL — Assemble pages interactively using the
plan!/assemble/construct!pipeline. - Extend to new formats — Implement custom
buildmethods to convert your own markup formats into pages, or integrate with tools like Clerk.
How does Fabricate work?
Fabricate works through three core functions: plan! collects sources, assemble builds documents from those sources, and construct! generates pages. Each function maps to a multimethod — collect, build, and produce! — which you can extend to handle new input formats. The API example threads an empty map through all three functions to produce a site, and the API documentation describes the details.
Alternatives
Fabricate belongs to the static site generator family, alongside tools like Hugo, Jekyll, and Next.js with static export. What distinguishes Fabricate is its use of Clojure as the generation language, which none of those alternatives offer.
FAQ
Does Fabricate support Markdown?
Not yet. Markdown support is planned, as is compatibility with the kindly protocol. Currently, sources are limited to templates containing Clojure expressions and Clojure files.
Is Fabricate's API stable?
The core API namespace site.fabricate.api is now stable. Any namespace containing the prototype prefix should be considered subject to change until it is promoted.
Can I extend Fabricate to other markup formats?
Yes. Fabricate defines three multimethods — collect, build, and produce! — which correspond to the three API functions. You can extend these multimethods to support new markup formats or alternate methods of generating pages.








