mirror of
https://github.com/yude-jp/yude.jp
synced 2024-12-22 20:20:09 +09:00
Add 404 page
This commit is contained in:
parent
4b673b8c9c
commit
299034c391
@ -9,6 +9,7 @@
|
||||
"/house": ["house", "common"],
|
||||
"/tos": ["tos", "common"],
|
||||
"/hcunews": ["hcunews", "common"],
|
||||
"/minecraft": ["minecraft", "common"]
|
||||
"/minecraft": ["minecraft", "common"],
|
||||
"/404": ["404", "common"]
|
||||
}
|
||||
}
|
4
locales/en/404.json
Normal file
4
locales/en/404.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"caption": "The requested page does not exist on this website.",
|
||||
"return": "Return to top"
|
||||
}
|
4
locales/ja/404.json
Normal file
4
locales/ja/404.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"caption": "要求されたページはこのウェブサイト上に存在しません。",
|
||||
"return": "トップページへ戻る"
|
||||
}
|
29
pages/404.js
Normal file
29
pages/404.js
Normal file
@ -0,0 +1,29 @@
|
||||
// Base layout
|
||||
import Layout from "./components/Layout"
|
||||
|
||||
// React Router
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// Next.js
|
||||
import Link from 'next/link'
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
export default function Custom404(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("404")
|
||||
|
||||
return (
|
||||
<Layout title="404">
|
||||
<div className="text-center mb-10 mt-10">
|
||||
<p className="text-3xl">404</p>
|
||||
<p className="text-xl">{t('caption')}</p>
|
||||
<Link href="/">
|
||||
<a>
|
||||
<p className="mt-5">{t('return')}</p>
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue
Block a user