fix(docs-site): publish function pages under /reference/
Generate documentation / build-docs (push) Successful in 2m59s

Cloudflare Pages reserves a top-level `functions/` directory in the deploy
output for Pages Functions (server-side handlers) and strips it from the
static-asset upload. The wrangler log for run 812 shows the collision
exactly: 159 files uploaded, which is precisely the number of files in
dist/ outside functions/ — all 108 files under it were dropped.

Nothing failed loudly. Astro built all 120 pages, wrangler reported
success, and the site worked under `astro preview`; only the deployed
copy 404'd on every function entry and category index.

Move the generated tree to /reference/ and add a test asserting the site
output never emits a name Pages reserves.
This commit is contained in:
2026-07-26 00:48:26 -04:00
parent d23cbfc733
commit 6cd0de7ccf
2 changed files with 32 additions and 2 deletions
+8 -1
View File
@@ -279,7 +279,14 @@ def build_site(root: Path, out: Path) -> list[dict]:
continue
# Section 5: category index page keeps its slot; entries explode.
slug_dir = "functions"
#
# Deliberately NOT "functions": Cloudflare Pages reserves a top-level
# `functions/` directory in the deploy output for Pages Functions
# (server-side handlers) and silently drops it from the static-asset
# upload. The pages build fine and never arrive — every entry 404s in
# production while working locally. test_site_avoids_reserved_dir
# guards this.
slug_dir = "reference"
if rel.name == "index.md":
target = out / slug_dir / "index.md"
target.parent.mkdir(parents=True, exist_ok=True)