mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-14 08:03:48 -05:00
V3
Many many many changes, honestly just read the release notes
This commit is contained in:
27
docs/src/app/[...mdxPath]/page.tsx
Normal file
27
docs/src/app/[...mdxPath]/page.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { generateStaticParamsFor, importPage } from "nextra/pages";
|
||||
import { useMDXComponents } from "@/mdx-components";
|
||||
|
||||
export const generateStaticParams = generateStaticParamsFor("mdxPath");
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ mdxPath: string[] }>;
|
||||
}
|
||||
|
||||
export async function generateMetadata(props: Props) {
|
||||
const params = await props.params;
|
||||
const { metadata } = await importPage(params.mdxPath);
|
||||
return metadata;
|
||||
}
|
||||
/* eslint-disable-next-line */
|
||||
const Wrapper = useMDXComponents({}).wrapper;
|
||||
|
||||
export default async function Page(props: Props) {
|
||||
const params = await props.params;
|
||||
const result = await importPage(params.mdxPath);
|
||||
const { default: MDXContent, toc, metadata } = result;
|
||||
return (
|
||||
<Wrapper toc={toc} metadata={metadata}>
|
||||
<MDXContent {...props} params={params} />
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user