Merge pull request #459 from kimwonj77/sitemap-filter

This commit is contained in:
Travis Fischer
2023-12-16 23:20:57 -06:00
committed by GitHub

View File

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