File tree Expand file tree Collapse file tree 1 file changed +4
-20
lines changed
Expand file tree Collapse file tree 1 file changed +4
-20
lines changed Original file line number Diff line number Diff line change 11import { loader } from 'fumadocs-core/source' ;
2- import { docs } from '@/.source' ;
2+ import { createMDXSource } from 'fumadocs-mdx' ;
3+ import { docs , meta } from '@/.source' ;
34
4- // Map the docs from .source to the format expected by loader
5- // Note: docs from .source is wrapped by _runtime.doc(), not a plain array
6- const mappedDocs = docs
7- . filter ( ( doc : any ) => doc && doc . info && doc . info . path )
8- . map ( ( doc : any ) => {
9- let path = doc . info . path . replace ( / \. m d x ? $ / , '' ) ;
10- // Convert index.mdx to empty path for root /docs route
11- if ( path === 'index' ) path = '' ;
12-
13- return {
14- type : 'page' as const ,
15- path,
16- data : {
17- ...doc . data ,
18- body : doc . data . default ,
19- } ,
20- } ;
21- } ) ;
5+ const mdxSource = createMDXSource ( docs , meta ) ;
226
237export const source = loader ( {
248 baseUrl : '/docs' ,
259 source : {
26- files : mappedDocs ,
10+ files : mdxSource . files ( ) ,
2711 } ,
2812} ) ;
You can’t perform that action at this time.
0 commit comments