fix gitbook page not menu

This commit is contained in:
tangly1024.com
2024-02-02 14:31:41 +08:00
parent b53cc97acd
commit 33f3ea75c1
3 changed files with 3 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ export async function getStaticProps({ params: { prefix, slug, suffix } }) {
const props = await getGlobalData({ from })
// 在列表内查找文章
props.post = props?.allPages?.find((p) => {
return p.slug === fullSlug || p.id === idToUuid(fullSlug)
return (p.type.indexOf('Menu') < 0) && (p.slug === fullSlug || p.id === idToUuid(fullSlug))
})
// 处理非列表内文章的内信息

View File

@@ -46,7 +46,7 @@ export async function getStaticProps({ params: { prefix, slug } }) {
const props = await getGlobalData({ from })
// 在列表内查找文章
props.post = props?.allPages?.find((p) => {
return p.slug === fullSlug || p.id === idToUuid(fullSlug)
return (p.type.indexOf('Menu') < 0) && (p.slug === fullSlug || p.id === idToUuid(fullSlug))
})
// 处理非列表内文章的内信息

View File

@@ -101,7 +101,7 @@ export async function getStaticProps({ params: { prefix } }) {
const props = await getGlobalData({ from })
// 在列表内查找文章
props.post = props?.allPages?.find((p) => {
return p.slug === fullSlug || p.id === idToUuid(fullSlug)
return (p.type.indexOf('Menu') < 0) && (p.slug === fullSlug || p.id === idToUuid(fullSlug))
})
// 处理非列表内文章的内信息