File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ export default async function Page(props: {
4242 }
4343
4444 const MDXContent = page . data . body ;
45- const markdownUrl = `${ page . url === "/" ? "/index" : page . url } .mdx` ;
45+ const markdownPath =
46+ page . url === "/" ? "index" : page . url . replace ( / ^ \/ / , "" ) ;
47+ const markdownUrl = `/llms.mdx/${ markdownPath } ` ;
4648 const githubBaseUrl =
4749 process . env . NEXT_PUBLIC_DOCS_GITHUB_BASE_URL ||
4850 "https://github.com/codelitdev/medialit/blob/main/apps/docs/content/docs" ;
Original file line number Diff line number Diff line change @@ -4,12 +4,19 @@ import { getLLMText } from "@/lib/get-llm-text";
44export const revalidate = false ;
55
66export async function GET (
7- req : Request ,
8- _ctx : { params : Promise < Record < string , string | string [ ] > > } ,
7+ _req : Request ,
8+ {
9+ params,
10+ } : {
11+ params : Promise < { slug ?: string | string [ ] } | undefined > ;
12+ } ,
913) {
10- const pathname = new URL ( req . url ) . pathname ;
11- const relative = pathname . replace ( / ^ \/ + / , "" ) . replace ( / \. m d x $ / , "" ) ;
12- const slug = relative . length > 0 ? relative . split ( "/" ) : [ ] ;
14+ const rawSlug = ( await params ) ?. slug ;
15+ const slug = Array . isArray ( rawSlug )
16+ ? rawSlug
17+ : typeof rawSlug === "string"
18+ ? [ rawSlug ]
19+ : [ "index" ] ;
1320 const normalizedSlug =
1421 slug . length === 1 && slug [ 0 ] === "index" ? undefined : slug ;
1522 const page = source . getPage ( normalizedSlug ) ;
Original file line number Diff line number Diff line change 11import { createMDX } from 'fumadocs-mdx/next' ;
2- import { PHASE_DEVELOPMENT_SERVER } from "next/constants.js" ;
32
43const withMDX = createMDX ( ) ;
54
6- /** @type {import('next').NextConfig | ((phase: string) => import('next').NextConfig) } */
7- const config = ( phase ) => ( {
5+ /** @type {import('next').NextConfig } */
6+ const config = {
87 reactStrictMode : true ,
9- ... ( phase === PHASE_DEVELOPMENT_SERVER ? { } : { output : " export" } ) ,
8+ output : ' export' ,
109 images : {
1110 unoptimized : true ,
12- } ,
13- } ) ;
11+ }
12+ } ;
1413
15- export default withMDX ( config ) ;
14+ export default withMDX ( config ) ;
You can’t perform that action at this time.
0 commit comments