diff --git a/lib/types.ts b/lib/types.ts index 37b25ba..835c301 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -1,4 +1,5 @@ import { ExtendedRecordMap, PageMap } from 'notion-types' +import { ParsedUrlQuery } from 'querystring' export * from 'notion-types' @@ -16,6 +17,10 @@ export interface PageProps { error?: PageError } +export interface Params extends ParsedUrlQuery { + pageId: string +} + export interface Site { name: string domain: string diff --git a/pages/[pageId].tsx b/pages/[pageId].tsx index b92d68b..b9d573f 100644 --- a/pages/[pageId].tsx +++ b/pages/[pageId].tsx @@ -1,10 +1,12 @@ import * as React from 'react' +import { GetStaticProps } from 'next' import { isDev, domain } from 'lib/config' import { getSiteMap } from 'lib/get-site-map' import { resolveNotionPage } from 'lib/resolve-notion-page' +import { PageProps, Params } from 'lib/types' import { NotionPage } from 'components' -export const getStaticProps = async (context) => { +export const getStaticProps: GetStaticProps = async (context) => { const rawPageId = context.params.pageId as string try {