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.
This commit is contained in:
commit
8505b7e9e0
1003 changed files with 13289 additions and 0 deletions
32
tobias.raayoni-last.com/plugins/assetcheck.py
Normal file
32
tobias.raayoni-last.com/plugins/assetcheck.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
"""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)
|
||||
55
tobias.raayoni-last.com/plugins/lostimages.py
Normal file
55
tobias.raayoni-last.com/plugins/lostimages.py
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
"""Drop <img> tags in article bodies whose file did not survive the recovery.
|
||||
|
||||
The same situation as assetcheck.py, one level down: the recovered bodies kept
|
||||
their original /library/ references, and 22 of 200 point at files no archive
|
||||
holds (checked against Wayback; the CDX API returns no captures for them).
|
||||
|
||||
Left alone they render as a broken-image box, which on a phone reads as an
|
||||
unexplained 40px hole between paragraphs. The reference is still worth keeping
|
||||
in the Markdown source, so this strips it only from the generated HTML and
|
||||
leaves a comment naming the file, which keeps the output self-documenting for
|
||||
anyone who later finds the originals on the offline drive.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
|
||||
from pelican import signals
|
||||
|
||||
IMG = re.compile(r'<img[^>]*\bsrc="(/[^"]+)"[^>]*>')
|
||||
ANCHOR = re.compile(r'<a[^>]*\bhref="(/library/[^"]+)"[^>]*>(.*?)</a>', re.S)
|
||||
|
||||
|
||||
def _strip(content):
|
||||
body = getattr(content, "_content", None)
|
||||
if not body or "<img" not in body:
|
||||
return
|
||||
base = content.settings.get("PATH", "content")
|
||||
lost = []
|
||||
|
||||
def anchor(m):
|
||||
rel = m.group(1).lstrip("/")
|
||||
if os.path.exists(os.path.join(base, rel)):
|
||||
return m.group(0)
|
||||
return m.group(2)
|
||||
|
||||
def sub(m):
|
||||
rel = m.group(1).lstrip("/")
|
||||
if os.path.exists(os.path.join(base, rel)):
|
||||
return m.group(0)
|
||||
lost.append(os.path.basename(rel))
|
||||
return "<!-- lost image: %s -->" % os.path.basename(rel)
|
||||
|
||||
body = IMG.sub(sub, body)
|
||||
# a thumbnail that linked to the full-size file leaves the <a> behind, and
|
||||
# its href 404s just as the <img> did
|
||||
body = ANCHOR.sub(anchor, body)
|
||||
if not lost:
|
||||
return
|
||||
# a paragraph that held nothing but the lost image would still occupy space
|
||||
body = re.sub(r"<p>\s*((?:<!-- lost image: [^>]*-->\s*)+)</p>", r"\1", body)
|
||||
content._content = body
|
||||
content.lost_images = lost
|
||||
|
||||
|
||||
def register():
|
||||
signals.content_object_init.connect(_strip)
|
||||
Loading…
Add table
Add a link
Reference in a new issue