File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ export interface Params extends ParsedUrlQuery {
21
21
pageId : string
22
22
}
23
23
24
+ export interface PageParams extends ParsedUrlQuery {
25
+ pageId : string
26
+ }
27
+
24
28
export interface Site {
25
29
name : string
26
30
domain : string
Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ import { NotionPage } from '@/components/NotionPage'
5
5
import { domain , isDev } from '@/lib/config'
6
6
import { getSiteMap } from '@/lib/get-site-map'
7
7
import { resolveNotionPage } from '@/lib/resolve-notion-page'
8
- import { PageProps , Params } from '@/lib/types'
8
+ import { PageParams , PageProps } from '@/lib/types'
9
9
10
- export const getStaticProps : GetStaticProps < PageProps , Params > = async (
10
+ export const getStaticProps : GetStaticProps < PageProps , PageParams > = async (
11
11
context
12
12
) => {
13
- const rawPageId = context . params . pageId as string
13
+ const rawPageId = ( context . params . pageId ) . join ( '/' )
14
14
15
15
try {
16
16
const props = await resolveNotionPage ( domain , rawPageId )
@@ -38,7 +38,7 @@ export async function getStaticPaths() {
38
38
const staticPaths = {
39
39
paths : Object . keys ( siteMap . canonicalPageMap ) . map ( ( pageId ) => ( {
40
40
params : {
41
- pageId
41
+ pageId : pageId . split ( '/' )
42
42
}
43
43
} ) ) ,
44
44
// paths: [],
You can’t perform that action at this time.
0 commit comments