Each form factor now has an information page (purpose + live embedded widget), with priced BOMs only on the buildable hardware (Stage ≈$59, Micro ≈$28): - info-editor.html / info-initial.html — purpose only (web app / concept) - info-stage.html — purpose + the priced BOM moved out of stage.html - info-micro.html — purpose + a new ~$28 practice-unit BOM stage.html drops the BOM panel (+ its .bom CSS) and gains a "Spec & BOM" link; the shared .bom/.sub table CSS lives in src/base.css. "Info" added to every page nav and to the concept cards. Wired into build.sh + deploy.sh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38 lines
1.9 KiB
Bash
Executable file
38 lines
1.9 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Assemble the deployed single-file pages from source + shared partials + assets/.
|
|
#
|
|
# Both index.html and player.html are sources that share code via markers:
|
|
# /*@BUILD:include:src/<file>@*/ inlines a shared partial (engine, seed lists, base CSS)
|
|
# @BUILD:favicon@ / @BUILD:logo-*@ / /*@BUILD:samples@*/{} inline base64 assets
|
|
# This resolves them so each built page in dist/ is one self-contained file
|
|
# (zero deps, works fully offline). deploy.sh runs this first. dist/ is generated —
|
|
# don't edit or commit it.
|
|
set -euo pipefail
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
mkdir -p dist
|
|
python3 - <<'PY'
|
|
import json, os, pathlib, re
|
|
A = pathlib.Path("assets")
|
|
SAMPLES = json.dumps(json.load(open(A / "samples.json")))
|
|
|
|
def build(name):
|
|
src = pathlib.Path(name).read_text()
|
|
# 1) inline shared partials (function-replacement: no backslash/group interpretation)
|
|
src = re.sub(r"/\*@BUILD:include:([^@]+)@\*/",
|
|
lambda m: pathlib.Path(m.group(1)).read_text().rstrip("\n"), src)
|
|
# 2) inline base64 assets
|
|
src = src.replace("@BUILD:favicon@", (A / "favicon.b64").read_text().strip())
|
|
src = src.replace("@BUILD:logo-dark@", (A / "logo-dark.b64").read_text().strip())
|
|
src = src.replace("@BUILD:logo-light@", (A / "logo-light.b64").read_text().strip())
|
|
src = src.replace("/*@BUILD:samples@*/{}", SAMPLES)
|
|
assert "@BUILD:" not in src, f"unresolved build marker(s) remain in {name}"
|
|
out = pathlib.Path("dist") / name
|
|
out.write_text(src)
|
|
return out.stat().st_size
|
|
|
|
for name in ("index.html","player.html","stage.html","micro.html","concepts.html","embed.html",
|
|
"info-editor.html","info-initial.html","info-stage.html","info-micro.html"):
|
|
print("built %s (%dKB)" % (name, build(name) // 1024))
|
|
pathlib.Path("dist/embed.js").write_text(pathlib.Path("embed.js").read_text()) # loader, served as-is
|
|
print("copied embed.js")
|
|
PY
|