Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions apps/docs/src/app/r/[[...name]]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { handle } from "hono/vercel";
import app from "./registry";
import { getRegistryIndex } from "@proofkit/registry";

const handler = handle(app);
export {
Expand All @@ -11,3 +12,29 @@ export {
handler as OPTIONS,
handler as HEAD,
};

// Generate static params for all registry routes
export async function generateStaticParams() {
try {
const index = await getRegistryIndex();

const params = [
// Root registry route
{ name: [] },
// Individual component routes
...index.map((item) => ({
name: item.name.split('/'),
})),
// Meta routes for each component
...index.map((item) => ({
name: ['meta', ...item.name.split('/')],
})),
];

console.log('Generated static params for registry:', params);
return params;
} catch (error) {
console.error('Failed to generate static params for registry:', error);
return [{ name: [] }];
}
}
Loading