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,9 +54,8 @@ export const getStaticProps: GetStaticProps<PropsPage, ParsedUrlQuery> = async (
if (!args.params) {
return { notFound: true }
}
return {
props: {
mdx: await serialize(
const mdx = await serialize(
fs.readFileSync(`${path.join('docs', ...args.params.listPathPage)}.mdx`, 'utf-8'),
{
parseFrontmatter: true,
@ -64,7 +63,11 @@ export const getStaticProps: GetStaticProps<PropsPage, ParsedUrlQuery> = async (
remarkPlugins,
},
}
),
)
return {
props: {
mdx,
},
}
}