归档文章数量修复

This commit is contained in:
tangly1024
2022-02-21 12:35:36 +08:00
parent ec6e1c27d3
commit 475769fcf6

View File

@@ -28,7 +28,11 @@ export async function getGlobalNotionData ({
const notionPageData = await getNotionPageData({ pageId, from })
const tagOptions = notionPageData.tagOptions
const allPosts = await getAllPosts({ notionPageData, from, includePage })
const postCount = allPosts?.length
const postCount = allPosts?.filter(post =>
post.title && post.slug &&
post?.status?.[0] === 'Published' &&
(post?.type?.[0] === 'Post')
)?.length
const categories = await getAllCategories(allPosts)
const tags = await getAllTags({ allPosts, tagOptions, sliceCount: tagsCount })
// 深拷贝