Created
August 31, 2021 13:20
-
-
Save joshua-isaac/53fc288c817f2f6b0bfe22347a280f9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function getStaticProps({ | |
preview, | |
params, | |
locale, | |
defaultLocale, | |
locales, | |
}) { | |
const globalComponents = { | |
header: SiteHeader, | |
}; | |
const agilityProps = await getAgilityPageProps({ | |
preview, | |
params, | |
locale, | |
getModule, | |
defaultLocale, | |
globalComponents, | |
}); | |
if (agilityProps.notFound === true) { | |
return { | |
notFound: true, | |
}; | |
} | |
return { | |
props: agilityProps, | |
revalidate: 10, | |
}; | |
} | |
export async function getStaticPaths({ locales, defaultLocale }) { | |
let agilityPaths = await getAgilityPaths({ | |
preview: false, | |
locales, | |
defaultLocale, | |
}); | |
return { | |
paths: agilityPaths, | |
fallback: true, | |
}; | |
} | |
const AgilityPage = (props) => { | |
if (props.notFound === true) { | |
return <Error statusCode={404} />; | |
} | |
return <Layout {...props} />; | |
}; | |
export default AgilityPage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment