diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index e6ced3af..61c6a249 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -142,6 +142,20 @@ jobs: - name: Check falsifiers declare the budget they target run: python3 tests/check_falsifier_targets.py + - name: Check committed gallery matches its generator + # docs/gallery/ is committed, but pages.yml regenerates it at deploy, so a + # stale commit ships fine and drifts silently. Regenerate and require no diff. + run: | + python3 scripts/build_gallery.py + drift=$(git status --porcelain -- docs/gallery) + if [ -n "$drift" ]; then + echo "::error::docs/gallery/ is stale. Run 'python scripts/build_gallery.py' and commit the result." + echo "$drift" + git --no-pager diff --stat -- docs/gallery + exit 1 + fi + echo "docs/gallery/ matches scripts/build_gallery.py output." + - name: Validate template Python syntax run: | echo "Checking template Python syntax..." diff --git a/docs/gallery/assets/signpost-preview.webp b/docs/gallery/assets/signpost-preview.webp deleted file mode 100644 index 3724acb3..00000000 Binary files a/docs/gallery/assets/signpost-preview.webp and /dev/null differ diff --git a/docs/gallery/assets/wall-torch-preview.webp b/docs/gallery/assets/wall-torch-preview.webp deleted file mode 100644 index 8b4c01f8..00000000 Binary files a/docs/gallery/assets/wall-torch-preview.webp and /dev/null differ diff --git a/docs/gallery/index.html b/docs/gallery/index.html index 08a9383f..9aa64e5d 100644 --- a/docs/gallery/index.html +++ b/docs/gallery/index.html @@ -323,13 +323,11 @@

Examples and Showcase

- - @@ -712,7 +710,7 @@

custom-normals-shade

View example custom-normals-shade -
+
@@ -745,7 +743,7 @@

mesh-hygiene-audit

View example mesh-hygiene-audit
-
+ -
+ -
+
diff --git a/examples/gallery.json b/examples/gallery.json index 6c5de1ff..2fb69827 100644 --- a/examples/gallery.json +++ b/examples/gallery.json @@ -432,7 +432,7 @@ "tags": [ "world", "sky", - "render" + "rendering" ] }, { @@ -469,7 +469,7 @@ "hero": "docs/gallery/assets/prop-origin-transform-hero.webp", "preview": "examples/prop-origin-transform/preview.webp", "tags": [ - "transform", + "transforms", "parenting", "game-pipeline" ] @@ -551,7 +551,7 @@ "tags": [ "uv", "game-pipeline", - "render" + "rendering" ] }, { @@ -579,7 +579,7 @@ "mesh", "attributes", "game-pipeline", - "render" + "rendering" ] }, { diff --git a/scripts/build_gallery.py b/scripts/build_gallery.py index 657a0738..9a6f5e2d 100644 --- a/scripts/build_gallery.py +++ b/scripts/build_gallery.py @@ -1059,6 +1059,16 @@ def main() -> int: encoding="utf-8", ) + # A renamed or removed entry would otherwise leave its old page published + # forever. Only folders this generator wrote qualify: a lone index.html + # and nothing else, so assets/, contact-sheets/ and asset-sheets/ are safe. + names = {ex["name"] for ex in examples} + for d in sorted(p for p in OUT_DIR.iterdir() if p.is_dir() and p.name not in names): + if [c.name for c in d.iterdir()] == ["index.html"]: + (d / "index.html").unlink() + d.rmdir() + print(f"Removed stale page {d.relative_to(REPO)}") + n_showcase = sum(1 for ex in examples if "showcase" in (ex.get("tags") or [])) print( f"Wrote {OUT_DIR / 'index.html'} + {len(examples)} detail pages "