1- import { source } from '@/lib/source' ;
2- import {
3- DocsBody ,
4- DocsDescription ,
5- DocsPage ,
6- DocsTitle ,
7- } from 'fumadocs-ui/page' ;
8- import type { Metadata } from 'next' ;
9- import { notFound } from 'next/navigation' ;
10- import { createRelativeLink } from 'fumadocs-ui/mdx' ;
11- import { getMDXComponents } from '@/mdx-components' ;
1+ import { source } from "@/lib/source"
2+ import { DocsBody , DocsDescription , DocsPage , DocsTitle } from "fumadocs-ui/page"
3+ import type { Metadata } from "next"
4+ import { notFound } from "next/navigation"
5+ import { createRelativeLink } from "fumadocs-ui/mdx"
6+ import { getMDXComponents } from "@/mdx-components"
127
13- export default async function Page ( props : PageProps < ' /docs/[[...slug]]' > ) {
14- const params = await props . params ;
15- const page = source . getPage ( params . slug ) ;
16- if ( ! page ) notFound ( ) ;
8+ export default async function Page ( props : PageProps < " /docs/[[...slug]]" > ) {
9+ const params = await props . params
10+ const page = source . getPage ( params . slug )
11+ if ( ! page ) notFound ( )
1712
18- const MDXContent = page . data . body ;
13+ const MDXContent = page . data . body
1914
2015 return (
2116 < DocsPage toc = { page . data . toc } full = { page . data . full } >
@@ -25,27 +20,25 @@ export default async function Page(props: PageProps<'/docs/[[...slug]]'>) {
2520 < MDXContent
2621 components = { getMDXComponents ( {
2722 // this allows you to link to other pages with relative file paths
28- a : createRelativeLink ( source , page ) ,
23+ a : createRelativeLink ( source , page )
2924 } ) }
3025 />
3126 </ DocsBody >
3227 </ DocsPage >
33- ) ;
28+ )
3429}
3530
3631export async function generateStaticParams ( ) {
37- return source . generateParams ( ) ;
32+ return source . generateParams ( )
3833}
3934
40- export async function generateMetadata (
41- props : PageProps < '/docs/[[...slug]]' > ,
42- ) : Promise < Metadata > {
43- const params = await props . params ;
44- const page = source . getPage ( params . slug ) ;
45- if ( ! page ) notFound ( ) ;
35+ export async function generateMetadata ( props : PageProps < "/docs/[[...slug]]" > ) : Promise < Metadata > {
36+ const params = await props . params
37+ const page = source . getPage ( params . slug )
38+ if ( ! page ) notFound ( )
4639
4740 return {
4841 title : page . data . title ,
49- description : page . data . description ,
50- } ;
42+ description : page . data . description
43+ }
5144}
0 commit comments