diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 32089e30..122efb0c 100755 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -142,7 +142,7 @@ function getCustomNav({ allPages }) { * @returns */ 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 === 'Published') + const menuPages = collectionData.filter(post => post.status === 'Published' && (post?.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post?.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu)) const menus = [] if (menuPages && menuPages.length > 0) { menuPages.forEach(e => { diff --git a/themes/nav/components/MenuItem.js b/themes/nav/components/MenuItem.js index 539a9222..d44f8b17 100644 --- a/themes/nav/components/MenuItem.js +++ b/themes/nav/components/MenuItem.js @@ -22,7 +22,7 @@ export const MenuItem = ({ link }) => { // #号加标题 快速跳转到指定锚点 const isAnchor = link?.to === '#' - const url = isAnchor ? link.to : `#${link.name}` + const url = isAnchor ? `#${link.name}` : link.to return <> {/* 菜单 */} @@ -33,7 +33,7 @@ export const MenuItem = ({ link }) => { {link?.subMenus ? (<> - {link?.title} + {link?.title}