Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonworr committed Dec 29, 2020
1 parent 0759bae commit 9c96bc7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
if (dimensions) contactPage.featureImage = { url, dimensions }
}
}
if (!post && !page && !isContactPage) throw new Error(`Expected post or page for slug: ${slug}`)
if (!post && !page && !isContactPage) {
return {
notFound: true,
}
}

let previewPosts: GhostPostsOrPages | never[] = []
let prevPost: GhostPostOrPage | null = null
Expand Down Expand Up @@ -166,6 +170,6 @@ export const getStaticPaths: GetStaticPaths = async () => {

return {
paths,
fallback: enable
fallback: enable && "blocking"
}
}

0 comments on commit 9c96bc7

Please sign in to comment.