Skip to content

Commit

Permalink
Merge pull request #459 from kimwonj77/sitemap-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Dec 17, 2023
2 parents 149915e + 2901499 commit 75265e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/get-site-map.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
})
Expand Down

0 comments on commit 75265e0

Please sign in to comment.