File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
apps/docs/src/app/r/[[...name]] Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 11import { handle } from "hono/vercel" ;
22import app from "./registry" ;
3+ import { getRegistryIndex } from "@proofkit/registry" ;
34
45const handler = handle ( app ) ;
56export {
@@ -11,3 +12,29 @@ export {
1112 handler as OPTIONS ,
1213 handler as HEAD ,
1314} ;
15+
16+ // Generate static params for all registry routes
17+ export async function generateStaticParams ( ) {
18+ try {
19+ const index = await getRegistryIndex ( ) ;
20+
21+ const params = [
22+ // Root registry route
23+ { name : [ ] } ,
24+ // Individual component routes
25+ ...index . map ( ( item ) => ( {
26+ name : item . name . split ( '/' ) ,
27+ } ) ) ,
28+ // Meta routes for each component
29+ ...index . map ( ( item ) => ( {
30+ name : [ 'meta' , ...item . name . split ( '/' ) ] ,
31+ } ) ) ,
32+ ] ;
33+
34+ console . log ( 'Generated static params for registry:' , params ) ;
35+ return params ;
36+ } catch ( error ) {
37+ console . error ( 'Failed to generate static params for registry:' , error ) ;
38+ return [ { name : [ ] } ] ;
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments