fix(web): render content pages dynamically so next build needs no DB
CI / typecheck + build (turbo) (push) Canceled after 0s

The home, doc, and search pages queried Postgres during SSG/static data
collection, so 'next build' failed in CI (no DB). Mark them
force-dynamic (and drop generateStaticParams from the doc page) so they
render at request time — instant at this corpus scale and build-safe
without a live database.
This commit is contained in:
asepharyana
2026-08-19 22:56:01 +07:00
parent b454a0fbac
commit 8790a4f65a
3 changed files with 14 additions and 8 deletions
+6 -8
View File
@@ -3,6 +3,12 @@ import { notFound } from "next/navigation";
import { getDocument, listDocuments, getRelated, listRevisions } from "@mcpedia/core";
import Markdown from "@/components/Markdown";
// Render at request time. The content lives in Postgres (populated by the
// indexer/worker), which is not available at build time (CI has no DB), so we
// opt out of static generation. At this corpus scale request-time rendering is
// instant.
export const dynamic = "force-dynamic";
export default async function DocPage({
params,
}: {
@@ -80,11 +86,3 @@ export default async function DocPage({
</article>
);
}
export async function generateStaticParams() {
const docs = await listDocuments();
return docs.map((d) => ({
section: d.section,
slug: d.slug.split("/").slice(1),
}));
}