ombryt

Guide

Documentation sites

ombryt has a built-in theme for documentation. A project needs a folder of markdown and four lines of configuration; the theme brings the layout, the navigation, search, highlighting and light and dark modes. These pages are made with it.

Start #

ombryt init docs --theme docs
cd docs
ombryt serve

That makes:

docs/
├── ombryt.toml          [build] theme = "docs"
└── src/
    ├── _data.yaml       links in the header and the navigation
    ├── index.md
    └── guide/
        ├── index.md
        ├── installation.md
        └── usage.md

Every page with a title is in the sidebar. The front matter decides where:

---
title: Installation
parent: Guide       # the title of the page this one is under; leave out for the top level
nav_order: 1        # order among its siblings (then by title)
---

Pages nest up to three levels (a page, its children, their children). The previous and next links at the end of each page follow the same order. Other fields the theme reads:

Field
nav_titlea shorter title for the sidebar and the pager
nav_exclude: trueleave the page out of the navigation
hide_title: trueno <h1> from the title (when the page has its own)
hide_toc: trueno "On this page" list
grand_parentshown in the breadcrumb, for third-level pages

parent: Guide in src/guide/_data.yaml saves writing it in every page of a directory. The directory's own index.md then needs parent: "".

src/_data.yaml has the links:

top_links:            # in the header
  - title: GitHub
    url: https://github.com/you/project
nav_links:            # below the navigation
  - title: Changelog
    url: https://github.com/you/project/blob/main/CHANGELOG.md

A file in the project wins over the theme's file of the same name:

To changeAdd
the stylesheetsrc/theme/docs.css (start from the theme's)
the iconsrc/favicon.svg
tags in <head> (analytics, fonts)src/_includes/head.html
the footersrc/_includes/footer.html (footer_hide_generator: true drops the "Built with" line)
the page layoutsrc/_includes/page.html or base.html
highlighting, searchthe same settings in ombryt.toml

A theme can also be a directory: theme = "my-theme" reads my-theme/theme.toml, _data.yaml, _includes/ and assets/, with the same rules.

Publishing with GitHub Actions #

ombryt has a reusable workflow that installs ombryt, builds the docs and deploys them to GitHub Pages. In a project, add .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

Then pick "GitHub Actions" as the source under Settings → Pages. A custom domain is set there as well, with a CNAME DNS record pointing at <user>.github.io.

InputDefault
pathdocsthe directory with ombryt.toml
versionlatestthe ombryt version, such as 0.1.0
stricttruefail on broken links
deploytruefalse builds (and checks) without deploying, for pull requests
urlthe site'soverride site.url, e.g. for a preview

With deploy: false the workflow is a check that the docs build, which suits pull requests:

on: pull_request
jobs:
  docs:
    uses: Hexagon/ombryt/.github/workflows/docs.yml@v0
    with:
      deploy: false

Only installing ombryt #

For workflows of your own, the Hexagon/ombryt action installs a release, checks it against its checksums and its build provenance, and puts it on the PATH:

steps:
  - uses: actions/checkout@v4
  - uses: Hexagon/ombryt@v0
    with:
      version: latest
  - run: ombryt -C docs build --strict

It works on Linux, macOS and Windows runners.

Coming from Lumocs #

Lumocs projects move with few changes: title, nav_order and parent mean the same, and top_links and nav_links in _data.json work as they are (icons are ignored). Replace _config.ts and deno.json with an ombryt.toml, and the Deno steps in the workflow with the reusable one.