mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-04 07:26:47 +00:00
菜单Page可隐藏
This commit is contained in:
@@ -87,10 +87,12 @@ function getCustomNav({ allPage }) {
|
|||||||
const customNav = []
|
const customNav = []
|
||||||
if (allPage && allPage.length > 0) {
|
if (allPage && allPage.length > 0) {
|
||||||
allPage.forEach(p => {
|
allPage.forEach(p => {
|
||||||
if (p?.slug?.indexOf('http') === 0) {
|
if (p?.status?.[0] === 'Published') {
|
||||||
customNav.push({ icon: p.icon || null, name: p.title, to: p.slug, show: true })
|
if (p?.slug?.indexOf('http') === 0) {
|
||||||
} else {
|
customNav.push({ icon: p.icon || null, name: p.title, to: p.slug, show: true })
|
||||||
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 => {
|
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 => {
|
const allPosts = data.filter(post => {
|
||||||
return post.title && post?.status?.[0] === 'Published' && ['Post'].indexOf(post?.type?.[0]) > -1
|
return post.title && post?.status?.[0] === 'Published' && ['Post'].indexOf(post?.type?.[0]) > -1
|
||||||
|
|||||||
Reference in New Issue
Block a user