diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 076a56c3..feb7e786 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -87,10 +87,12 @@ function getCustomNav({ allPage }) { const customNav = [] if (allPage && allPage.length > 0) { allPage.forEach(p => { - if (p?.slug?.indexOf('http') === 0) { - customNav.push({ icon: p.icon || null, name: p.title, to: p.slug, show: true }) - } else { - customNav.push({ icon: p.icon || null, name: p.title, to: '/' + p.slug, show: true }) + if (p?.status?.[0] === 'Published') { + if (p?.slug?.indexOf('http') === 0) { + customNav.push({ icon: p.icon || null, name: p.title, to: p.slug, show: true }) + } else { + customNav.push({ icon: p.icon || null, name: p.title, to: '/' + p.slug, show: true }) + } } }) } @@ -253,7 +255,7 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { } const allPage = data.filter(post => { - return post.title && post?.status?.[0] === 'Published' && ['Page'].indexOf(post?.type?.[0]) > -1 + return post.title && (post?.status?.[0] === 'Published' || post?.status?.[0] === 'Invisible') && ['Page'].indexOf(post?.type?.[0]) > -1 }) const allPosts = data.filter(post => { return post.title && post?.status?.[0] === 'Published' && ['Post'].indexOf(post?.type?.[0]) > -1