Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 4c1f1d2

Browse files
committed
Display blocks obj
1 parent 5d8c49a commit 4c1f1d2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pages/[...slug].js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export default function Page({post}) {
2828
<section>
2929
<article>
3030
<h1 dangerouslySetInnerHTML={{__html: post?.title}} />
31-
<div dangerouslySetInnerHTML={{__html: post?.blocksJSON}} />
31+
<div
32+
dangerouslySetInnerHTML={{
33+
__html: JSON.stringify(post?.blocks ?? [])
34+
}}
35+
/>
3236
</article>
3337
</section>
3438
</div>

pages/posts/[[...slug]].js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export default function BlogPost({post}) {
2828
<section>
2929
<article>
3030
<h1 dangerouslySetInnerHTML={{__html: post?.title}} />
31-
<div dangerouslySetInnerHTML={{__html: post?.blocksJSON}} />
31+
<div
32+
dangerouslySetInnerHTML={{
33+
__html: JSON.stringify(post?.blocks ?? [])
34+
}}
35+
/>
3236
</article>
3337
</section>
3438
</div>

0 commit comments

Comments
 (0)