Skip to content

Commit 1d9a659

Browse files
feat: add maxDepth to limit depth of pages in space to pre-render
1 parent 53b5dc4 commit 1d9a659

File tree

3 files changed

+39
-31
lines changed

3 files changed

+39
-31
lines changed

lib/get-site-map.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,20 @@ const getPage = async (pageId: string, opts?: any) => {
3737

3838
async function getAllPagesImpl(
3939
rootNotionPageId: string,
40-
rootNotionSpaceId?: string
40+
rootNotionSpaceId?: string,
41+
{
42+
maxDepth = 1
43+
}: {
44+
maxDepth?: number
45+
} = {}
4146
): Promise<Partial<types.SiteMap>> {
4247
const pageMap = await getAllPagesInSpace(
4348
rootNotionPageId,
4449
rootNotionSpaceId,
45-
getPage
50+
getPage,
51+
{
52+
maxDepth
53+
}
4654
)
4755

4856
const canonicalPageMap = Object.keys(pageMap).reduce(

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@
4141
"ky": "^1.8.1",
4242
"lqip-modern": "^2.2.1",
4343
"next": "^15.3.3",
44-
"notion-client": "^7.4.1",
45-
"notion-types": "^7.4.1",
46-
"notion-utils": "^7.4.1",
44+
"notion-client": "^7.4.2",
45+
"notion-types": "^7.4.2",
46+
"notion-utils": "^7.4.2",
4747
"p-map": "^7.0.3",
4848
"p-memoize": "^7.1.1",
4949
"posthog-js": "^1.249.4",
5050
"prismjs": "^1.30.0",
5151
"react": "^19.1.0",
5252
"react-body-classname": "^1.3.1",
5353
"react-dom": "^19.1.0",
54-
"react-notion-x": "^7.4.1",
54+
"react-notion-x": "^7.4.2",
5555
"react-tweet": "^3.2.2",
5656
"react-use": "^17.6.0",
5757
"rss": "^1.2.2"

pnpm-lock.yaml

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)