mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
22 lines
596 B
TypeScript
22 lines
596 B
TypeScript
import { NotionPage } from '@/components/NotionPage'
|
|
import { domain } from '@/lib/config'
|
|
import { resolveNotionPage } from '@/lib/resolve-notion-page'
|
|
|
|
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} />
|
|
}
|