-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic 404. #247
Add basic 404. #247
Conversation
671110a
to
9fd0ab0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9fd0ab0
to
7064c99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works great.
@@ -203,6 +203,11 @@ export const getServerSideProps: GetServerSideProps = async (context) => { | |||
const id = context?.params?.id; | |||
const collection = await getCollection(id as string); | |||
|
|||
if (typeof collection === "undefined") | |||
return { | |||
notFound: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice and easy
7064c99
to
510f8d1
Compare
What does this do?
This work adds a basic custom 404 page. The page is basically just reusing the Hero component on the homepage to render a single slide. Additionally, it adds navigation to the end user to direct them back to actual content.
The image itself can be easily swapped out by adjusting a IIIF thumbnail on the pageNotFoundCollection object at
lib/constants/404.ts
if we decided on different one.I also fixed a small bug in the HeroBasic component where the
bgImage
prop does not drill down as expected to some inline CSS. This was notice when working through an initial idea.