This commit is contained in:
tangly1024.com
2023-03-24 09:58:11 +08:00
parent 8af16870f9
commit bb1ddcec48

View File

@@ -100,8 +100,8 @@ function getCustomNav({ allPages }) {
* @param {*} allPages * @param {*} allPages
* @returns * @returns
*/ */
function getCustomMenu({ allPages }) { function getCustomMenu({ collectionData }) {
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) 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 = [] const menus = []
if (menuPages && menuPages.length > 0) { if (menuPages && menuPages.length > 0) {
menuPages.forEach(e => { menuPages.forEach(e => {
@@ -244,7 +244,7 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
const siteInfo = getBlogInfo({ collection, block }) const siteInfo = getBlogInfo({ collection, block })
const customNav = getCustomNav({ allPages: collectionData.filter(post => post.type === 'Page' && post.status === 'Published') }) 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 }) const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 })
return { return {