From 556c3d5e4ca9f7ba4aa60c405eb7e2dcc718aed9 Mon Sep 17 00:00:00 2001 From: DefectingCat Date: Wed, 17 May 2023 09:32:50 +0800 Subject: [PATCH] update mdx source types --- app/p/[slug]/page.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/p/[slug]/page.tsx b/app/p/[slug]/page.tsx index 92e37db..4da5af9 100644 --- a/app/p/[slug]/page.tsx +++ b/app/p/[slug]/page.tsx @@ -12,6 +12,7 @@ import { notFound } from 'next/navigation'; import { Suspense, lazy } from 'react'; import rehypeSlug from 'rehype-slug'; import remarkGfm from 'remark-gfm'; +import { Post } from 'types'; const PostComment = lazy(() => import('components/post/post-comment')); @@ -34,7 +35,7 @@ const Page = async ({ return childLen ? prev + childLen + 1 : prev + 1; }; const tocLength = toc.reduce(calcLength, 0); - const mdxSource = await compileMDX({ + const mdxSource = await compileMDX({ source: post, options: { parseFrontmatter: true, @@ -53,9 +54,7 @@ const Page = async ({ return ( <>
- {/* @ts-expect-error Async Server Component */}

{mdxSource.frontmatter?.title}

- {/* @ts-expect-error Async Server Component */}