diff --git a/lib/get-site-map.ts b/lib/get-site-map.ts index 7018406..984e3db 100644 --- a/lib/get-site-map.ts +++ b/lib/get-site-map.ts @@ -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('Public', block, recordMap) ?? true)) { + return map + } + const canonicalPageId = getCanonicalPageId(pageId, recordMap, { uuid })