From bb1ddcec484a796dc0399f08200ceb1cf8aa5548 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Fri, 24 Mar 2023 09:58:11 +0800 Subject: [PATCH] menu --- lib/notion/getNotionData.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index e2fcf242..7c476431 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -100,8 +100,8 @@ function getCustomNav({ allPages }) { * @param {*} allPages * @returns */ -function getCustomMenu({ allPages }) { - const menuPages = allPages.filter(post => (post.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) && post.status === BLOG.NOTION_PROPERTY_NAME.status_publish) +function getCustomMenu({ collectionData }) { + const menuPages = collectionData.filter(post => (post.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) && post.status === BLOG.NOTION_PROPERTY_NAME.status_publish) const menus = [] if (menuPages && menuPages.length > 0) { menuPages.forEach(e => { @@ -244,7 +244,7 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { const siteInfo = getBlogInfo({ collection, block }) const customNav = getCustomNav({ allPages: collectionData.filter(post => post.type === 'Page' && post.status === 'Published') }) // 新的菜单 - const customMenu = await getCustomMenu({ allPages }) + const customMenu = await getCustomMenu({ collectionData }) const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 }) return {