mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
filter non-public page on sitemap
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getAllPagesInSpace, uuidToId } from 'notion-utils'
|
||||
import { getAllPagesInSpace, uuidToId, getPageProperty } from 'notion-utils'
|
||||
import pMemoize from 'p-memoize'
|
||||
|
||||
import * as config from './config'
|
||||
@@ -47,6 +47,11 @@ async function getAllPagesImpl(
|
||||
throw new Error(`Error loading page "${pageId}"`)
|
||||
}
|
||||
|
||||
const block = recordMap.block[pageId]?.value
|
||||
if (!(getPageProperty<boolean|null>('Public', block, recordMap) ?? true)) {
|
||||
return map
|
||||
}
|
||||
|
||||
const canonicalPageId = getCanonicalPageId(pageId, recordMap, {
|
||||
uuid
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user