Require refuses an empty value. Heading ids: an explicit {#id} must be sound
and unique, generated ids avoid the explicit ones and each other, and a heading
with no ASCII letters gets a fallback. Fenced code blocks keep their
placeholders and a backslash keeps one anywhere. The em dash rule covers the
header of the manifesto pages and the HTML entities. The feed makes src links
absolute, base_url is required, and the news page must be a folder index. A
category written twice in a post counts once, a block name in a news title is no
longer taken for a placeholder, and build refuses extra arguments.
3.4 KiB
motorino
The static site generator of kmalloc.org. It turns Markdown pages, news, templates and language files into plain HTML with no JavaScript. It is made for that one site and is not a general-purpose generator.
Licence: GPL-3.0-or-later, see LICENSE.
Usage
motorino build -site DIR -out DIR build the site in DIR into the output folder (defaults: . and public)
motorino version print the version
The binary is a single static Go program. The version comes from semantic-release.
What a site looks like
site.json shared strings (contact, addresses, base_url), the language list, the assets
lang/<lang>.json menu, footer and other interface strings of one language
content/<lang>/**/*.md the pages; index.md is the home of a folder
news/<name>.md the news, one file each
templates/**/*.html the page chrome, the layouts, the news post and category page
static/style.css the stylesheet, inlined in every page
The first language in site.json is the default and lives at the root of the site; the others live under /<lang>/.
Header
Every page and every news file starts with lines of Key: value, ended by a line that holds a single -. The body is Markdown, and raw HTML is allowed in it.
News:
Title: GNU/Linux Day 2026
Author: Matteo Bini
Date: 2026-09-18T17:00:45+0200
Categories: Linux Day, FLUG
Description: An optional one-line summary.
-
The text of the news.
A news file news/name.md is published as /news/YYYY/MM/name.html, with the year and the month of Date as written. Every category gets a page, /news/category/<name>.html.
Pages: Title, ID (the same in every language, it links the translations), Description, and optionally Layout (page, bare or manifesto), Note, Switch (lang=/path, lang=/path, overrides the language links) and ManifestoVersion and ManifestoDate (a translation of an older manifesto says which version it translates).
Placeholders
{{name}}, with lowercase letters, digits and underscores, is replaced by a string from site.json or the language file. An unknown placeholder stops the build and names the file. Fenced code blocks are left as written, so an article can show a placeholder there; elsewhere a backslash before the placeholder (\{{name}}) keeps it as written, and Markdown drops the backslash. Code spans are substituted, which is how a page shows a value in monospace. {{news_list}}, {{latest_news}} and {{categories_list}} stand alone in a paragraph and expand to generated lists.
Development
make check gofmt, go vet, staticcheck and the tests
make build a local binary in bin/motorino
make dist the release binary and its SHA-256 in dist/
Go code has a doc comment on every package and declaration, and is formatted with gofmt. Commits follow conventional commits. A Forgejo Actions workflow (.forgejo/workflows/check.yml) runs make check on every push to main and on every pull request, on the shared runner of git.kmalloc.org.
Release
semantic-release is run by hand from a clean main: npm run release:dry, then npm run release. It tags vX.Y.Z, updates CHANGELOG.md, builds the linux/amd64 binary and publishes it, with its SHA-256, as a release on this repository. The site deploy pins a version and checks the hash before it runs the binary.