From 2db4816eeae969fd1149ee99586a44b1d1024055 Mon Sep 17 00:00:00 2001 From: RedhairHambagu <129669334+RedhairHambagu@users.noreply.github.com> Date: Mon, 24 Apr 2023 21:35:27 +0800 Subject: [PATCH] fix only display toc of current page --- pages/[...slug].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/[...slug].js b/pages/[...slug].js index 8ed9f270..d51ef3ef 100644 --- a/pages/[...slug].js +++ b/pages/[...slug].js @@ -31,7 +31,7 @@ const Slug = props => { setLock(true) } else { if (!lock && post?.blockMap?.block) { - post.content = Object.keys(post.blockMap.block) + post.content = Object.keys(post.blockMap.block).filter(key => post.blockMap.block[key]?.value.parent_id === post.id) post.toc = getPageTableOfContents(post, post.blockMap) }