announcement

This commit is contained in:
tangly1024.com
2023-02-10 17:14:05 +08:00
parent eaece6163b
commit 39865d202a
14 changed files with 144 additions and 74 deletions

View File

@@ -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,