Demo build: publish the console's ui/ package with the page
index.html links ui/v1/tokens.css document-relatively, and tokens.css loads the Inter font next to it, but build_demo.py copied only the brand assets into _site. The published demo therefore got a 404 for both (checked against the live site on 2026-11-21) and rendered with neither the shared tokens nor the font. It now copies frontend/ui/ into the output as well, the font's licence included. Checked: a build into an empty directory and a second one over it both succeed, and the served demo answers 200 for tokens.css and InterVariable.woff2, with the body in Inter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f304faf06f
commit
628a78d7d1
@@ -2,7 +2,8 @@
|
||||
"""Build the public live-demo page = frontend/index.html + a seeded mock-API layer (no backend).
|
||||
|
||||
Usage: python scripts/build_demo.py [outdir] (default outdir: _site)
|
||||
Run from the repo root. Writes <outdir>/index.html (+ .nojekyll) for GitHub Pages.
|
||||
Run from the repo root. Writes <outdir>/index.html (+ .nojekyll, the brand assets and the
|
||||
console's ui/ package) for GitHub Pages.
|
||||
The real frontend/index.html is never modified."""
|
||||
import os
|
||||
import shutil
|
||||
@@ -260,4 +261,8 @@ open(os.path.join(OUTDIR, ".nojekyll"), "w").close()
|
||||
# Brand assets referenced by the social-preview <head> tags above (absolute URLs).
|
||||
for asset in ("og.png", "icon.png"):
|
||||
shutil.copyfile(os.path.join(ROOT, "assets", asset), os.path.join(OUTDIR, asset))
|
||||
print(f"wrote {OUTDIR}/index.html ({len(out)} bytes) + .nojekyll + og.png + icon.png")
|
||||
# The family's shared design package, which index.html links document-relatively
|
||||
# (ui/v1/tokens.css, and through it the Inter font). Without it the published demo gets a 404 for
|
||||
# both and renders with neither the tokens nor the font.
|
||||
shutil.copytree(os.path.join(ROOT, "frontend", "ui"), os.path.join(OUTDIR, "ui"), dirs_exist_ok=True)
|
||||
print(f"wrote {OUTDIR}/index.html ({len(out)} bytes) + .nojekyll + og.png + icon.png + ui/")
|
||||
|
||||
Reference in New Issue
Block a user