mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
announcement
This commit is contained in:
@@ -169,6 +169,15 @@ const mapCollectionImg = (img, value) => {
|
||||
}
|
||||
}
|
||||
|
||||
async function getNotice(post) {
|
||||
if (!post) {
|
||||
return null
|
||||
}
|
||||
|
||||
post.blockMap = await getPostBlocks(post.id, 'data-notice')
|
||||
return post
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用NotionAPI获取Page数据
|
||||
* @returns {Promise<JSX.Element|null|*>}
|
||||
@@ -236,6 +245,7 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
|
||||
})
|
||||
}
|
||||
|
||||
const notice = await getNotice(collectionData.filter(post => { return post?.type === 'Notice' && post.status === 'Published' })?.[0])
|
||||
const categoryOptions = getAllCategories({ allPages, categoryOptions: getCategoryOptions(schema) })
|
||||
const tagOptions = getAllTags({ allPages, tagOptions: getTagOptions(schema) })
|
||||
const siteInfo = getBlogInfo({ collection, block })
|
||||
@@ -243,6 +253,7 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
|
||||
const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 })
|
||||
|
||||
return {
|
||||
notice,
|
||||
siteInfo,
|
||||
allPages,
|
||||
collection,
|
||||
|
||||
Reference in New Issue
Block a user