-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jj
committed
Apr 21, 2021
1 parent
4fd9e63
commit ba93b02
Showing
3 changed files
with
65 additions
and
17 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
import Link from 'next/link' | ||
import { GetStaticProps } from 'next' | ||
|
||
import { Layout } from '@components/Layout' | ||
import { HeaderPage } from '@components/HeaderPage' | ||
import { PostCard } from '@components/PostCard' | ||
|
||
import { getAllPosts, getAllSettings, GhostSettings, GhostPostsOrPages } from '@lib/ghost' | ||
import { useLang, get } from '@utils/use-lang' | ||
import { BodyClass } from '@helpers/BodyClass' | ||
|
||
export const getStaticProps: GetStaticProps = async () => { | ||
const posts = await getAllPosts({ limit: 3 }) | ||
const settings = await getAllSettings() | ||
|
||
return { | ||
props: { | ||
settings, | ||
posts, | ||
bodyClass: BodyClass({}) | ||
}, | ||
} | ||
} | ||
|
||
interface Custom404Props { | ||
posts: GhostPostsOrPages | ||
settings: GhostSettings | ||
bodyClass: string | ||
} | ||
|
||
export default function Custom404({ posts, settings, bodyClass }: Custom404Props) { | ||
const text = get(useLang()) | ||
|
||
return ( | ||
<Layout {...{ settings, bodyClass }} header={<HeaderPage {...{ settings }} />} errorClass="error-content"> | ||
<div className="inner"> | ||
<section className="error-message"> | ||
<h1 className="error-code">404</h1> | ||
<p className="error-description">{text(`PAGE_NOT_FOUND`)}</p> | ||
<Link href="/" ><a className="error-link">{text(`GOTO_FRONT_PAGE`)} →</a></Link> | ||
</section> | ||
|
||
<div className="post-feed"> | ||
{posts.map((post, i) => ( | ||
<PostCard key={post.id} {...{ settings, post, num: i }} /> | ||
))} | ||
</div> | ||
|
||
</div> | ||
</Layout> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4366,11 +4366,6 @@ unist-util-is@^4.0.0: | |
resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.0.4.tgz#3e9e8de6af2eb0039a59f50c9b3e99698a924f50" | ||
integrity sha512-3dF39j/u423v4BBQrk1AQ2Ve1FxY5W3JKwXxVFzBODQ6WEvccguhgp802qQLKSnxPODE6WuRZtV+ohlUg4meBA== | ||
|
||
unist-util-is@^5.0.0: | ||
version "5.0.0" | ||
resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-5.0.0.tgz#c71eddea34aa7009d54f671a6fafb3779b8035d3" | ||
integrity sha512-G4p13DhfdUNmlnJxd0uy5Skx1FG58LSDhX8h1xgpeSq0omOQ4ZN5BO54ToFlNX55NDTbRHMdwTOJXqAieInSEA== | ||
|
||
unist-util-stringify-position@^2.0.0: | ||
version "2.0.3" | ||
resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" | ||
|
@@ -4385,13 +4380,13 @@ unist-util-visit-parents@^2.0.0: | |
dependencies: | ||
unist-util-is "^3.0.0" | ||
|
||
unist-util-visit-parents@^4.0.0: | ||
version "4.0.0" | ||
resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-4.0.0.tgz#0dfc00046ac753517ffaaf59b80d1ac892b352a6" | ||
integrity sha512-QyATSx30wHguIzI82+GVeuXGnFlh3AUVcyeZPOo5Paz2Z52zfRe3/0WLlBv6XlMWcr5xEdFqox6PteUL6hzEFA== | ||
unist-util-visit-parents@^3.0.0: | ||
version "3.1.1" | ||
resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" | ||
integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== | ||
dependencies: | ||
"@types/unist" "^2.0.0" | ||
unist-util-is "^5.0.0" | ||
unist-util-is "^4.0.0" | ||
|
||
unist-util-visit@^1.3.0: | ||
version "1.4.1" | ||
|
@@ -4400,14 +4395,14 @@ unist-util-visit@^1.3.0: | |
dependencies: | ||
unist-util-visit-parents "^2.0.0" | ||
|
||
unist-util-visit@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-3.0.0.tgz#a8e239038f7b29aadc649a6080f42bc85ea1a7bc" | ||
integrity sha512-RbFwAZhMekKPZxlAhUIiBwim8NogwUtwLbIjvZehaGORYRDWcApsnGI1VDUHr/Jo6yW1u8VOqO/djbd7Hpz88A== | ||
unist-util-visit@^2.0.3: | ||
version "2.0.3" | ||
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" | ||
integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== | ||
dependencies: | ||
"@types/unist" "^2.0.0" | ||
unist-util-is "^5.0.0" | ||
unist-util-visit-parents "^4.0.0" | ||
unist-util-is "^4.0.0" | ||
unist-util-visit-parents "^3.0.0" | ||
|
||
[email protected]: | ||
version "1.0.0" | ||
|
ba93b02
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.
Successfully deployed to the following URLs:
ba93b02
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.
Successfully deployed to the following URLs:
next-cms-ghost-no-custom-404 – ./
next-cms-ghost-no-custom-404-styxlab.vercel.app
next-cms-ghost-no-custom-404.vercel.app
next-cms-ghost-no-custom-404-git-master-styxlab.vercel.app