Extract logic

This commit is contained in:
Marcus Blättermann 2022-11-16 20:48:13 +01:00
parent 6fa2bf2fff
commit dcf8455f77
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D

View File

@ -54,17 +54,20 @@ export const getStaticProps: GetStaticProps<PropsPage, ParsedUrlQuery> = async (
if (!args.params) {
return { notFound: true }
}
const mdx = await serialize(
fs.readFileSync(`${path.join('docs', ...args.params.listPathPage)}.mdx`, 'utf-8'),
{
parseFrontmatter: true,
mdxOptions: {
remarkPlugins,
},
}
)
return {
props: {
mdx: await serialize(
fs.readFileSync(`${path.join('docs', ...args.params.listPathPage)}.mdx`, 'utf-8'),
{
parseFrontmatter: true,
mdxOptions: {
remarkPlugins,
},
}
),
mdx,
},
}
}