
The real output on the sources of kmalloc.org. For the last two lines a made-up placeholder was added to one page, to show the error.
In the post on why kmalloc.org exists I gave motorino one sentence: Markdown in, plain HTML out, no JavaScript. This is the long version.
motorino is the static site generator that builds kmalloc.org. It reads Markdown pages, news, templates and language files, and writes plain HTML and a Gemini capsule. The third sentence of its README is the important one: “It is made for that one site and is not a general-purpose generator.”
It is written in Go, it is free software under the GPL-3.0-or-later, and the code is at git.kmalloc.org/squid/motorino.
Why not Hugo
This blog is built with Hugo. kmalloc.org never was.
The first commit of the site, on 12 November, already had its own generator: a Python script called build.py, 444 lines, standard library only. The texts of the pages were in JSON language files and in HTML templates with placeholders. Only the manifesto and the news were Markdown.
Three days later I opened the first issue of a new repository. It starts like this: “I want to replace the Python build script of kmalloc.org with a generator of its own, written in Go.” The list under it is short: all the pages in Markdown, the news with a header and dated addresses, the same output as the Python build, one dependency, and a release as a pinned binary.
So motorino did not replace a general generator. It replaced a script, and gave it a name, a repository, tests and versions.
What does a generator for one site look like, compared with a general one? This is what I find in the code:
- The rules of the site are in the generator. kmalloc.org shows no em dashes. A news file that has one stops the build with
news/name.md:6: no em dashes, please. For the manifesto, whose sources use them, the file that rewrites them contains literal pieces of sentences of the manifesto, in English and in Italian. That only makes sense in a tool for one site. - Mistakes stop the build. An unknown placeholder is an error that names the file. So is an address that leads nowhere in the capsule, and so are two pages that want the same address.
- The page header knows the site. There is a layout called
manifesto, and the keysManifestoVersionandManifestoDate, for a translation that is behind the English text. - A lot is missing on purpose. No themes, no plugins, no configuration language.
go.modhas one dependency, goldmark, for the Markdown.
How it is built
A site is a folder:
site.json shared strings, the language list, the assets
lang/<lang>.json menu, footer and 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
static/style.css the stylesheet, inlined in every page
Every page and every news file starts with lines of Key: value, ended by a line that holds a single -. Then comes the Markdown, and raw HTML is allowed in it.
Title: A pastebin: paste.kmalloc.org
Author: squid
Date: 2026-11-16T12:58:00+0100
Categories: News
Description: Share a piece of text or code with a link.
-
There is now a pastebin.
A news file news/name.md is published as /news/YYYY/MM/name.html, and every category gets a page. The first language of site.json lives at the root of the site and the others under /<lang>/. The news exist once, not once per language.
The templates are simple. {{name}} is replaced by a string from site.json or from the language file, and that is all a template can do: no loops and no conditions. The lists, such as {{news_list}} or {{latest_news}}, are written by Go code.
The program has four commands: build, gemini, new (it writes a draft with the header ready) and version. The code is one cmd/motorino and eight small packages under internal/: header, site, content, mdx, render, build, gemtext and version. Counted with wc -l on version 1.3.0, that is about 4,700 lines of Go and about 4,400 lines of tests.
Today kmalloc.org is 25 Markdown files: 18 pages in five languages and 7 news. motorino turns them into 29 HTML pages, about 345 KB in total. On my machine a build takes about 20 milliseconds, the average of 20 runs. A grep for <script in the output finds nothing.

The News page, from a local build. The list, the dates and the category links are generated; the rest is one Markdown file.

A post. The line under the summary comes from the header of the file.
Two days of history
The git log is short, and the turning points are easy to find.
- 15 November, 1.0.0. The site moved to motorino the same day. The commit that moved it says the output matched the one of
build.pypage by page, checked with a small compare tool and with the Nu HTML Checker. Then the Python script was removed. - 15 November, 1.2.0. “Take the menu from the site, not from the code.” The menu entries were three lists in Go, and the commit message says what was wrong with that: “a new menu entry meant a new motorino release”. Now the header template decides what is in the menu and in which order. Only the home page and the news section are still required by the code, because motorino builds them itself.
- 16 November, 1.3.0. The news became a small blog: drafts, posts dated in the future, a list with pages, an archive by year and month, the full text in the feed. And the Gemini output.
The capsule comes from the same Markdown
Gemini is a small protocol for reading text. Its format, gemtext, has headings, one-line paragraphs, bullets, quotes, preformatted blocks and links on lines of their own. Nothing else: no emphasis, no links inside the text, no tables, no images.
motorino gemini reads the same site and writes it as gemtext. It does not read the templates, the stylesheet or the layouts: a page is its title, its text and a few navigation links.
There is no second Markdown renderer. The Markdown becomes HTML with goldmark, as for the website, and the gemtext package converts that HTML. It parses it with the lenient mode of Go’s encoding/xml, so there is no new dependency. The price is that the raw HTML I write in a page must be well formed.
The rules of the conversion are in the README. A few of them:
- The links of a paragraph follow it, each on a line of its own.
- A table is a preformatted block of aligned columns. When it is wider than 80 columns it becomes a heading for each row, with a bullet for each cell.
- An image with an alt text is a link line. An image that belongs to the layout, such as the logo, is left out.
- An address of the site becomes the address of its page in the capsule. One that leads nowhere stops the build.

One news file and the start of the gemtext written from it.
The command also writes a .meta file that tells the Gemini server the language of each folder, and news/feed.gmi, a list of dated links that Gemini clients can subscribe to. For kmalloc.org that is 30 gemtext files, in about 55 milliseconds. The capsule is at gemini://kmalloc.org.
The deploy pins a binary
motorino is one static Go program, and the site never builds it from source.
A release is made by hand, with semantic-release: npm run release from a clean main. This is the only thing Node is used for, and package.json says so: “Release tooling of motorino. The generator itself is Go”. The version comes from the conventional commits. The release tags it, updates the changelog, runs make dist and publishes two files: the linux/amd64 binary, 4.1 MB, and its SHA-256.
The repository of the site has a file of two lines, .motorino-version:
1.3.0
de9e44d1b2e7924579371787b9c54de6772e579d81344927fcc392c772b9715c
A push to main publishes the site. The deploy downloads that version once, checks it against that hash, builds into a new folder and mirrors the folder into the web root. If the hash or the build is wrong, nothing is copied and the old site stays. The check workflow of the site does the same on every pull request, and then runs the Nu HTML Checker on every page.
Two things follow. The machine that builds the site needs no Go toolchain. And a new version of the generator reaches the site only with a commit in the repository of the site, so the history of the site says which motorino built it. The hash is written there too, not only next to the binary.
What it still lacks
- A preview server. There is no
serveand no watch mode. To look at a page I build into a folder and serve it withpython3 -m http.server. - Markdown extensions. goldmark runs with heading ids and raw HTML, and nothing more: no tables, no footnotes, no syntax highlighting. The data table of the Services page is HTML written by hand.
- Logic in the templates. Placeholders only. A new kind of generated list is new Go code and a new release.
- Cleaning by default. A build writes its files and leaves the others, so the pages of a list that got shorter stay in the folder. It prints a warning, and
-cleanempties the folder first. The deploy does not have the problem, because it always builds into a new folder. - News in more than one language. They exist once, in one language.
- Other platforms. The release has one binary,
linux/amd64. On anything else it ismake build. - Other sites. It has been used on exactly one.
If you want to read it
motorino is not meant for your site, and the README says so. But it is small enough to read from main.go to the end, and the Gemini part may be useful to someone who wants a capsule from Markdown they already have.
The code is at git.kmalloc.org/squid/motorino, and the site it builds is at git.kmalloc.org/squid/kmalloc.org. If you find a mistake, open an issue there or write below.