Merge pull request #1008 from RedhairHambagu/fix/slug-toc-current-page

fix only display toc of current page
This commit is contained in:
tangly1024
2023-04-26 12:05:59 +08:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -155,6 +155,11 @@
<td align="center">
<a href="https://github.com/hongzzz" style="display:inline-block;width:80px"><img src="https://avatars.githubusercontent.com/u/25585061" width="64px;" alt="Hongzzz"/><br/><sub><b>Hongzzz</b></sub></a><br/><a href="https://github.com/tangly1024/NotionNext/commits?author=hongzzz" title="hongzzz" >🔧 🐛</a>
</td>
<td align="center">
<a href="https://github.com/RedhairHambagu" style="display:inline-block;width:80px"><img src="https://avatars.githubusercontent.com/u/129669334" width="64px;" alt="RedhairHambagu"/><br/><sub><b>RedhairHambagu</b></sub></a><br/><a href="https://github.com/tangly1024/NotionNext/commits?author=RedhairHambagu" title="RedhairHambagu" >🔧 🐛</a>
</td>
</tr>
</table>

View File

@@ -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)
}