mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
feature:
优化单页面JSON文件
This commit is contained in:
@@ -37,6 +37,7 @@ export async function getAllPosts ({ notionPageData, from, includePage = false }
|
||||
properties.tagItems = properties?.tags?.map(tag => {
|
||||
return { name: tag, color: tagOptions.find(t => t.value === tag)?.color || 'gray' }
|
||||
}) || []
|
||||
delete properties.content
|
||||
data.push(properties)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user