菜单Page可隐藏

This commit is contained in:
tangly1024
2022-05-16 14:45:41 +08:00
parent a3f2494f56
commit 1e0ef1aee9

View File

@@ -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