Skip to content

Commit 75265e0

Browse files
Merge pull request #459 from kimwonj77/sitemap-filter
2 parents 149915e + 2901499 commit 75265e0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/get-site-map.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getAllPagesInSpace, uuidToId } from 'notion-utils'
1+
import { getAllPagesInSpace, uuidToId, getPageProperty } from 'notion-utils'
22
import pMemoize from 'p-memoize'
33

44
import * as config from './config'
@@ -47,6 +47,11 @@ async function getAllPagesImpl(
4747
throw new Error(`Error loading page "${pageId}"`)
4848
}
4949

50+
const block = recordMap.block[pageId]?.value
51+
if (!(getPageProperty<boolean|null>('Public', block, recordMap) ?? true)) {
52+
return map
53+
}
54+
5055
const canonicalPageId = getCanonicalPageId(pageId, recordMap, {
5156
uuid
5257
})

0 commit comments

Comments
 (0)