From 2ed0a0d09a8b299f9854ab21c855da8544efe0b4 Mon Sep 17 00:00:00 2001 From: ishaan1124 Date: Tue, 13 Oct 2026 10:57:22 +0800 Subject: [PATCH] chore(docs): drop the unused docs 404 rewrite With cleanUrls, Vercel doesn't rewrite to a .html destination, so unknown /docs paths already got the site's 404 with a real 404 status. Remove the dead rewrite and stop generating docs/404.html. Co-authored-by: Cursor --- frontend/docs/script/prerender.ts | 19 +++---------------- frontend/landing/vercel.json | 4 ---- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/frontend/docs/script/prerender.ts b/frontend/docs/script/prerender.ts index bddd277f9..bbb89182a 100644 --- a/frontend/docs/script/prerender.ts +++ b/frontend/docs/script/prerender.ts @@ -1,6 +1,6 @@ // Runs after the client and SSR builds. Writes every page to dist/.html -// with its own title, description, canonical URL and JSON-LD, plus 404.html -// for unknown paths and sitemap.xml, so each page can be indexed on its own. +// with its own title, description, canonical URL and JSON-LD, plus sitemap.xml, +// so each page can be indexed on its own. Unknown paths get the site's 404. import path from "node:path" import { BASE, SITE, documentTitle, pageUrl } from "../src/navigation" @@ -99,19 +99,6 @@ for (const name of order) { await Bun.write(path.join(dist, name === "index" ? "index.html" : name + ".html"), html) } -// Unknown /docs paths are rewritten here by the site's vercel.json. -const missing = withHead(template, { - title: documentTitle("Page not found"), - description: "This documentation page does not exist or has moved.", - url: SITE + BASE, -}) - .replace( - /( before + "noindex" + after, - ) - .replace(slot, () => `
${render(BASE + "/404")}
`) -await Bun.write(path.join(dist, "404.html"), missing) - await Bun.write( path.join(dist, "sitemap.xml"), ` @@ -120,4 +107,4 @@ ${order.map((name) => ` \n ${pageUrl(name)}\n `).join `, ) -console.log(`Prerendered ${order.length} documentation pages, 404.html and sitemap.xml.`) +console.log(`Prerendered ${order.length} documentation pages and sitemap.xml.`) diff --git a/frontend/landing/vercel.json b/frontend/landing/vercel.json index ac7c09a5b..9a80f81c0 100644 --- a/frontend/landing/vercel.json +++ b/frontend/landing/vercel.json @@ -46,10 +46,6 @@ { "source": "/docs", "destination": "/docs/index.html" - }, - { - "source": "/docs/:path*", - "destination": "/docs/404.html" } ] }