feat: draw site images from data, host them

scripts/sitediagrams.py writes the explainer, install flow, verification modes, MinUI card, pipeline and data layer diagrams as inline SVG from the registry, the platform files, the install manifests and the pipeline step list. A page asks for one with an image comment, which the decoration pass resolves. The two mermaid diagrams of the architecture page are replaced, so no page loads mermaid from unpkg.

Platform logos and system icons are copied once by fetch_site_images.py with their source and owner recorded, and the build rewrites the remote links to the copies. validate_site refuses an image from another host. Three registry logos named a personal avatar instead of the project's (RomM, ROCKNIX, MiSTer FPGA) and MyMinUI's was a GitHub identicon, now dropped.

One 1200x630 sharing card per section, a 404 page with search and the two entry pages, and a list of screenshots that need a real device.
This commit is contained in:
Abdessamad Derraz committed 2026-10-22 11:45:47 +02:00
1 parent f1c58820d1
commit 1b9ea86e1b
120 files changed
+1963 -176

No files matched your search

+14 -2
View File
@@ -1810,11 +1810,16 @@ def decorate_markdown_pages(docs: Path) -> None:
relative = path.relative_to(docs)
if any(part in LOCAL_NOTE_DIRS for part in relative.parts[:-1]):
continue
markdown = path.read_text(encoding="utf-8")
original = path.read_text(encoding="utf-8")
markdown = prepare_page(original, relative)
for image_id in unresolved_images(markdown):
print(f" WARNING: {relative}: no diagram named {image_id!r}", file=sys.stderr)
stripped = _undecorated(markdown)
if stripped is not markdown:
markdown = stripped
elif markdown.startswith("---\n"):
if markdown != original:
write_decorated(path, markdown)
continue
title = _page_title(markdown, relative)
@@ -5647,6 +5652,12 @@ def _generate(args: argparse.Namespace) -> None:
images_dest = docs / "assets" / "images"
images_dest.mkdir(parents=True, exist_ok=True)
# Logos, system icons and sharing cards are served from the site itself
# (docs_assets/*/sources.json records where each came from).
for folder in ("logos", "system-icons", "og"):
source = Path("docs_assets") / folder
if source.is_dir():
shutil.copytree(source, docs / "assets" / folder, dirs_exist_ok=True)
assets_src = Path(".github") / "assets"
for name, dest_name in [("logo.png", "logo.png"), ("favicon.png", "favicon.png")]:
src = assets_src / name
@@ -6003,6 +6014,7 @@ validation:
if stale:
print(f"Removed {stale} page(s) nothing produced this run")
from sitediagrams import prepare_page, unresolved_images # noqa: E402,F401
from sitewrite import ( # noqa: E402,F401
_produced,
_record,
@@ -6042,7 +6054,7 @@ from siterender import ( # noqa: E402,F401
prime_system_icons,
_icon_available,
SYSTEM_ICON_BASE,
ICON_CACHE_PATH,
ICON_DIR,
)
if __name__ == "__main__":