Skip to content

Commit

Permalink
Merge pull request #10 from akshatmittal/master
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
styxlab committed Dec 29, 2020
2 parents 4dc3137 + 6e92d7a commit 8e2984c
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'
}
}

1 comment on commit 8e2984c

@vercel
Copy link

@vercel vercel bot commented on 8e2984c Dec 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.