Files
nextjs-notion-starter-kit/pages/index.tsx
Travis Fischer c07548d53f 🖌
2021-02-06 00:39:06 -05:00

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} />
}