mirror of
https://github.com/pykeio/ort
synced 2026-04-26 00:44:56 +02:00
docs: nextra v4
This commit is contained in:
21
docs/app/[[...mdxPath]]/page.tsx
Normal file
21
docs/app/[[...mdxPath]]/page.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { generateStaticParamsFor, importPage } from 'nextra/pages';
|
||||
import { useMDXComponents as getMDXComponents } from '../../mdx-components';
|
||||
|
||||
export const generateStaticParams = generateStaticParamsFor('mdxPath');
|
||||
|
||||
export async function generateMetadata(props) {
|
||||
const params = await props.params;
|
||||
const { metadata } = await importPage(params.mdxPath);
|
||||
return metadata;
|
||||
}
|
||||
|
||||
const Wrapper = getMDXComponents().wrapper;
|
||||
|
||||
export default async function DocsPage(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