mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-30 07:26:49 +00:00
23 lines
605 B
TypeScript
23 lines
605 B
TypeScript
import React from 'react'
|
|
import { domain } from 'lib/config'
|
|
import { resolveNotionPage } from 'lib/resolve-notion-page'
|
|
import { NotionPage } from 'components'
|
|
|
|
export const getStaticProps = async () => {
|
|
try {
|
|
const props = await resolveNotionPage(domain)
|
|
|
|
return { props, revalidate: 10 }
|
|
} catch (err) {
|
|
console.error('page error', domain, err)
|
|
|
|
// we don't want to publish the error version of this page, so
|
|
// let next.js know explicitly that incremental SSG failed
|
|
throw err
|
|
}
|
|
}
|
|
|
|
export default function NotionDomainPage(props) {
|
|
return <NotionPage {...props} />
|
|
}
|