Merge pull request #677 from timlrx/fix/json-ld

fix: ld json serialization
This commit is contained in:
Timothy 2023-08-11 21:36:31 +08:00 committed by GitHub
commit f4380299c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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