优化单页面JSON文件
This commit is contained in:
tangly1024
2021-12-15 12:56:40 +08:00
parent f8694456ef
commit ec768dec47
2 changed files with 2 additions and 0 deletions

View File

@@ -172,6 +172,7 @@ export async function getStaticProps ({ params: { slug } }) {
const blockMap = await getPostBlocks(post.id, 'slug')
post.toc = []
if (blockMap) {
post.content = Object.keys(blockMap.block)
post.toc = getPageTableOfContents(post, blockMap)
}