mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 15:10:14 +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 => {
|
properties.tagItems = properties?.tags?.map(tag => {
|
||||||
return { name: tag, color: tagOptions.find(t => t.value === tag)?.color || 'gray' }
|
return { name: tag, color: tagOptions.find(t => t.value === tag)?.color || 'gray' }
|
||||||
}) || []
|
}) || []
|
||||||
|
delete properties.content
|
||||||
data.push(properties)
|
data.push(properties)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ export async function getStaticProps ({ params: { slug } }) {
|
|||||||
const blockMap = await getPostBlocks(post.id, 'slug')
|
const blockMap = await getPostBlocks(post.id, 'slug')
|
||||||
post.toc = []
|
post.toc = []
|
||||||
if (blockMap) {
|
if (blockMap) {
|
||||||
|
post.content = Object.keys(blockMap.block)
|
||||||
post.toc = getPageTableOfContents(post, blockMap)
|
post.toc = getPageTableOfContents(post, blockMap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user