sites/tobias.raayoni-last.com/plugins/assetcheck.py
randogoth 8505b7e9e0 Three sites, one directory each
flux.vision, tobias.raayoni-last.com and randogoth.com. They were one site until
October 2026, serving four audiences from a single dated list, which is the only
format that can hold unrelated things at once.

flux.vision is recovered from the Wayback Machine, where it had sat since being
deleted in 2021: 90 articles, closed and maintained rather than updated.
tobias.raayoni-last.com is the professional record, 97 articles back to 1999.
randogoth.com is the technical work, 41 articles across six areas, served as an
ANSI bulletin board.

History starts here deliberately. The development history, the 266-row inventory
that records why each article went where it did, the Wayback pipelines, the
pruned articles, the source archives and the full-size images are kept beside
the repo rather than in it, so a clone is the web presence and not the argument
that produced it. REFACTOR.md is gitignored for the same reason. See README.md
for where that material lives, and keep it: the sort is not reproducible from
these three directories alone.

Each site documents itself in its own README, including the traps that cost time
and look like nothing when you get them wrong.
2026-10-05 20:54:45 +03:00

32 lines
1.1 KiB
Python

"""Flag Thumb:/Background: fields whose file did not survive the recovery.
The recovered articles kept their original image references even where the file
is unrecoverable -- deliberately, since the reference records what was there
(see IMAGES.md in the working material). 29 of 90 thumbnails and a similar share of heroes point at
files that no archive holds.
Resolving that in the browser via an <img> error handler means a visible flash
of broken image on a third of the grid. Checking at build time instead lets the
templates render a typographic card from the start, and keeps the metadata
intact rather than stripping it.
"""
import os
from pelican import signals
FIELDS = ("thumb", "background")
def _flag(content):
base = content.settings.get("PATH", "content")
for field in FIELDS:
ref = content.metadata.get(field)
if not ref:
continue
path = os.path.join(base, str(ref).lstrip("/"))
if not os.path.exists(path):
content.metadata[field + "_missing"] = True
def register():
signals.content_object_init.connect(_flag)