From 03618d2ae7ecde73fd8338caad3f733679e70e9b Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 9 Dec 2022 17:27:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E8=8F=9C=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getNotionData.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 50c84696..11913b2d 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -215,6 +215,9 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { // 读取映射 配置 let postCount = 0 + // 获取page作为自定义菜单 + const customNav = getCustomNav({ allPages: collectionData.filter(post => post.type === 'Page' && post.status === 'Published') }) + const allPages = collectionData.filter(post => { if (post.type === 'Post' && post.status === 'Published') { postCount++ @@ -236,7 +239,6 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { }) } - const customNav = getCustomNav({ allPages }) const categories = getAllCategories({ allPages, categoryOptions, sliceCount: BLOG.PREVIEW_CATEGORY_COUNT }) const tags = getAllTags({ allPages, sliceCount: BLOG.PREVIEW_TAG_COUNT, tagOptions }) const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 })