feat: render randogoth.com as a small-net capsule

A Pelican generator that writes a capsule beside the HTML build: plain
Markdown plus per-directory .itsybitsy.toml sidecars, which a protocol daemon
converts per request to gemtext, XHTML-MP, WML or plain text.

The obstacle was recorded in the README as "smolweb reads YAML frontmatter
while Pelican uses bare Title: lines". Both halves turned out to be wrong:
itsybitsy parses no frontmatter at all, by design, and metadata lives outside
the document. So the transform is not a translation between dialects, it is a
removal, and a protocol daemon stays ignorant of one static generator.

Nothing in plugins/smolnet.py is specific to this site. Every difference is a
setting and every setting has a default, so another site enables it with
PLUGINS = ['smolnet']. It sits at the repo root for the same reason
flux.vision reaches into tobias.raayoni-last.com for lostimages.

Index entries are emitted as link-only paragraphs rather than Markdown lists,
which is not a style choice: the gemtext renderer prints a bare => line for a
paragraph holding nothing but links, and a bullet *and* a => line for a list
item, so a list would publish every entry twice. Gemini clients number link
lines themselves, so the board's dial-an-area-by-number idiom survives into
the capsule without emitting a single bracket. The trade-off is in the
docstring: the text renderer reflows such a run into prose, which costs
nothing here because randogoth.com is not getting Nex or Gopher.

Also drops a Zemanta tracking pixel that came in with a 2012 blog import and
is live on the site today, firing a third-party request on every view of that
article. It would have been worse in the capsule, where an image becomes a
visible link line advertising a dead tracker. It was the only one across all
three sites.

Verified by serving the output with the real daemon: 41 articles, 2 pages, 6
area indexes and an archive, no metadata surviving, no {filename} left,
trl@posteo.net revealed on Connect where the renderer would otherwise have
dropped it with its enclosing HTML, images served as image/png, and the index
rendering as a clean run of => lines in gemtext and as XHTML Mobile over HTTP.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
randogoth 2026-10-06 08:24:18 +03:00
parent 4853e5b360
commit 5131f1f53f
3 changed files with 366 additions and 7 deletions

View file

@ -9,8 +9,8 @@ DEFAULT_LANG = 'en'
# *application*: grey chrome, dialogs, a menu bar. A board is a different thing,
# and the one actually wanted here. mc-pelican stays in the tree as the fallback.
THEME = 'bbs'
PLUGIN_PATHS = ['plugins']
PLUGINS = ['crtimages']
PLUGIN_PATHS = ['plugins', '../plugins']
PLUGINS = ['crtimages', 'smolnet']
# The sections are message areas, numbered so they can be dialled by key the way
# a board's main menu works. No descriptions: the names are the whole listing,
@ -20,6 +20,20 @@ BBS_AREAS = {
'MACHINES': 4, 'GONZO': 5, 'ENDTIMES': 6,
}
# The capsule mirrors the board: same areas, same order, same words. Gemini
# clients number link lines themselves, so an area is still dialled by number
# over there without the plugin writing a single bracket.
SMOLNET_SECTION_DIR = 'area'
SMOLNET_SECTION_ORDER = BBS_AREAS
SMOLNET_LABELS = {
'sections': 'Message areas', 'latest': 'Latest messages',
'archive': 'All messages', 'back': 'Main menu', 'pages': 'System',
}
# The address is rot13 in the HTML because of web crawlers. That defence needs
# JavaScript, which Gemini does not have, and the renderer drops raw HTML, so
# without this the one thing the Connect page exists to carry would vanish.
SMOLNET_ROT13_ATTR = 'data-r'
# Articles live flat in content/; assets are carved out of that.
ARTICLE_PATHS = ['']
ARTICLE_EXCLUDES = ['pages', 'library', 'images', 'files']