Skip to content

Instantly share code, notes, and snippets.

@joshua-isaac
Created August 31, 2021 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshua-isaac/53fc288c817f2f6b0bfe22347a280f9f to your computer and use it in GitHub Desktop.
Save joshua-isaac/53fc288c817f2f6b0bfe22347a280f9f to your computer and use it in GitHub Desktop.
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