ombryt: a static site generator in a single binary

by Hexagon, 4 min read ombryt lumocs rust static-site-generator documentation markdown github-actions seo

Three years ago I wrote about Lumocs, a documentation generator built on Deno and Lume. It worked, but every site needed a runtime, a deno.json, a _config.ts and a set of pinned imports. ombryt is what came after: one binary, markdown and Jinja templates in, a complete site out. This blog is built with it, and so is croner.56k.guru.


Why another one

Lumocs was a thin layer over Lume. That was its strength, and also the problem. A small documentation site had a JavaScript runtime, a module graph and a handful of plugins behind it, and each of them moved at its own pace. Updating meant matching the Lume version with the Lumocs version, and then fixing whatever had changed in between.

What I wanted was the opposite: a tool you download once, that does the things every site needs without plugins, and that keeps doing them the same way until you choose to upgrade.

ombryt is that tool. It is written in Rust, has no runtime dependencies, and a 150-page blog builds in about 0.6 seconds. The name is Swedish: ombrytning is the step in printing where text is laid out into pages.

Installing it

There are three ways, depending on where you are.

From crates.io, if you have a Rust toolchain:

cargo install ombryt --locked

As a binary, from the GitHub releases. There are archives for Linux (x86_64 and arm64, statically linked), macOS (Apple silicon and Intel) and Windows. The file names carry no version, so the newest is always at the same address:

curl -sSL https://github.com/Hexagon/ombryt/releases/latest/download/ombryt-x86_64-unknown-linux-musl.tar.gz | tar xz

Every release is built by GitHub Actions from its tag, and signed there with a short-lived Sigstore certificate. There is no signing key to steal. You can check a download against GitHub's build provenance:

gh attestation verify ombryt-x86_64-unknown-linux-musl.tar.gz --repo Hexagon/ombryt

In GitHub Actions, with the action, which is covered below.

Getting started

ombryt init my-site && cd my-site
ombryt serve

serve builds the site, starts a dev server and reloads the browser after each rebuild, which takes milliseconds. ombryt build writes the site to _site, ombryt new "Title" creates a post, and ombryt themes lists the highlighting themes.

The whole configuration lives in one ombryt.toml. This is the one for this blog, nearly complete:

[site]
url = "https://hexagon.56k.guru"
title = "Hexagon's Blog"
language = "en"

[build]
src = "src"
out = "_site"
strict_links = true

[highlight]
theme = "OneHalfDark"
light_theme = "OneHalfLight"
light_selector = "[data-theme=light]"

[[feeds]]
query = "post"
limit = 20
rss = "/feed.rss"
json = "/feed.json"
content = "intro"

What it does

Things I kept adding as plugins to every site are built in:

  • Markdown (CommonMark with tables, footnotes, task lists and alerts), heading ids and a table of contents.
  • Templates with MiniJinja: layouts that wrap layouts, includes, macros, and search.pages() to list other pages. Anyone coming from Nunjucks will feel at home.
  • A data cascade: _data.yaml (or .json, .toml) per directory, merged with front matter. The _data.json files of this blog still work as they did under Lume.
  • Clean URLs from file names, with dates taken from names like 2026-11-27_ombryt.md.
  • Syntax highlighting at build time with bat's grammars, 200+ languages, as CSS classes with a light and a dark theme. No JavaScript highlighter in the browser.
  • Feeds in RSS, Atom and JSON Feed.
  • Taxonomy pages, one per tag, and drafts.
  • Inlined CSS and JS with an inline attribute on a <link> or <script>.

SEO, without thinking about it

The boring parts of being found are done for every page, unless the template has done them already:

  • A sitemap.xml with lastmod from updated or date, and priority if the page sets one. sitemap: false leaves a page out.
  • A meta description, and Open Graph and Twitter tags. The description comes from metas.description, description, intro or the site description, in that order. og:type is article for pages with a date, and article:published_time is filled in.
  • metas values can point at other fields: metas: { description: "=intro" } in a _data.yaml sets it for a whole directory.

And then there is the link check. Every build checks every internal href and src, including absolute links to the site's own URL and #fragments into other pages. A fragment must name an element id that actually exists. Broken links are warnings, or errors with --strict or strict_links = true. Moving this blog over found a few links that had been broken for years.

A static site has no server to search on, so ombryt writes a JSON index for the browser instead:

[search]
index = "/search.json"
query = "post"
text = true

Each document has its url, title, description, tags, date, headings and, optionally, its text. The headings let a result link straight to the right section. For a few hundred pages, plain JavaScript over the index is fast enough. The ombryt docs do exactly that, in about 90 lines with no dependencies (press / there to try it). For fuzzy matching, the same array goes straight into MiniSearch, Fuse.js, Lunr or FlexSearch. For really large sites, Pagefind runs fine on ombryt's output.

Documentation sites, the Lumocs part

This is where ombryt replaces Lumocs. It has a built-in docs theme:

ombryt init docs --theme docs

A project then needs a folder of markdown and a few lines of configuration. The theme brings the layout, nested navigation up to three levels, search, syntax highlighting, light and dark modes and a layout for phones. Navigation is decided by the same front matter as in Lumocs:

---
title: Installation
parent: Guide
nav_order: 1
---

title, nav_order and parent mean the same, and top_links and nav_links in _data.json work as they are. Moving a Lumocs project means replacing _config.ts and deno.json with an ombryt.toml, and the Deno steps in the workflow with the reusable one below.

GitHub Actions and the Marketplace

The Hexagon/ombryt action is on the GitHub Marketplace as Setup ombryt. It installs a release and puts ombryt on the PATH:

steps:
  - uses: actions/checkout@v4
  - uses: Hexagon/ombryt@v0
  - run: ombryt build --strict

It downloads the archive for the runner, checks it against the release's SHA256SUMS, and verifies its build provenance with gh attestation verify. It runs on Linux (x64, ARM64), macOS and Windows runners. @v0 follows the newest 0.x release; pin version: 0.1.1 for builds that must not change.

For documentation there is also a reusable workflow that builds the site and publishes it to GitHub Pages. This is the whole .github/workflows/docs.yml:

name: docs
on:
  push:
    branches: [main]
  workflow_dispatch:
jobs:
  docs:
    uses: Hexagon/ombryt/.github/workflows/docs.yml@v0
    permissions:
      contents: read
      pages: write
      id-token: write
    with:
      path: docs

Pick "GitHub Actions" as the source under Settings → Pages, and you are done. With deploy: false the same workflow becomes a check for pull requests: the docs must build, and every link must lead somewhere.

Where it runs

ombryt is already doing real work:

  • This blog. It moved from Deno and Lume to ombryt with mostly mechanical template changes. Both made the same files, and ombryt added its highlight stylesheet. The source is on GitHub.
  • croner.56k.guru, the documentation for Croner, built with the docs theme.
  • ombryt.56k.guru, its own documentation.

Resources


Talking to my servers, and letting them take notes One cron pattern, five languages: Croner and OCPS