fix: ld json serialization

This commit is contained in:
Timothy Lin 2023-08-11 18:56:35 +08:00
parent 5226bfad9a
commit 78e47a210e

View File

@ -116,9 +116,10 @@ export default async function Page({ params }: { params: { slug: string[] } }) {
</div> </div>
) : ( ) : (
<> <>
<script type="application/ld+json" suppressHydrationWarning> <script
{JSON.stringify(jsonLd)} type="application/ld+json"
</script> dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<Layout content={mainContent} authorDetails={authorDetails} next={next} prev={prev}> <Layout content={mainContent} authorDetails={authorDetails} next={next} prev={prev}>
<MDXLayoutRenderer code={post.body.code} components={components} toc={post.toc} /> <MDXLayoutRenderer code={post.body.code} components={components} toc={post.toc} />
</Layout> </Layout>