From dfb642e187c742be0154ad1c6755f611031a71d3 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Fri, 24 Mar 2023 13:40:20 +0800 Subject: [PATCH] fix-build --- lib/notion/getNotionData.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 7c476431..a48c7b3c 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -220,13 +220,14 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { // 文章计数 let postCount = 0 + // 查找所有的Post和Page const allPages = collectionData.filter(post => { if (post.type === BLOG.NOTION_PROPERTY_NAME.type_post && post.status === BLOG.NOTION_PROPERTY_NAME.status_publish) { postCount++ } - return post && - (!post?.slug?.startsWith('http')) && - (post?.status === BLOG.NOTION_PROPERTY_NAME.status_publish || post?.status === BLOG.NOTION_PROPERTY_NAME.status_invisible) + return post && post?.slug && + (!post?.slug?.startsWith('http')) && + (post?.status === BLOG.NOTION_PROPERTY_NAME.status_publish || post?.status === BLOG.NOTION_PROPERTY_NAME.status_invisible) }) // Sort by date