fix: fix empty post bodies — stop double-compiling MDX
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { notFound } from 'next/navigation'
|
||||
import { MDXRemote } from 'next-mdx-remote/rsc'
|
||||
import { useMDXComponents } from '@/mdx-components'
|
||||
import remarkMath from 'remark-math'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import rehypePrettyCode from 'rehype-pretty-code'
|
||||
import rehypeKatex from 'rehype-katex'
|
||||
import { getPosts, getPost, getReadingTime } from '@/lib/posts'
|
||||
import { TableOfContents } from '@/components/blog/TableOfContents'
|
||||
import { ScrollToTop } from '@/components/ui/ScrollToTop'
|
||||
@@ -43,7 +48,19 @@ export default async function PostPage({ params }: { params: Promise<{ slug: str
|
||||
</p>
|
||||
</header>
|
||||
<div className="prose prose-lg max-w-none">
|
||||
<MDXRemote source={post.source} />
|
||||
<MDXRemote
|
||||
source={post.source}
|
||||
components={useMDXComponents({})}
|
||||
options={{
|
||||
mdxOptions: {
|
||||
remarkPlugins: [remarkMath, remarkGfm],
|
||||
rehypePlugins: [
|
||||
[rehypePrettyCode, { theme: 'github-dark' }],
|
||||
rehypeKatex,
|
||||
],
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</article>
|
||||
<aside className="hidden lg:block">
|
||||
|
||||
Reference in New Issue
Block a user