diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 61a5a934273..22303348190 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -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 }) // 深拷贝