mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
feat: add global 404 page
This commit is contained in:
@ -10,14 +10,18 @@ const GlobalError = ({
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) => {
|
||||
console.error(error);
|
||||
|
||||
return (
|
||||
<html>
|
||||
<body
|
||||
className={clsx('w-full h-dvh flex', 'justify-center items-center')}
|
||||
>
|
||||
<div>
|
||||
<h2 className="text-xl">Something went wrong! ノ( OωOノ)</h2>
|
||||
<Button onClick={() => reset()}>Try again</Button>
|
||||
<h2 className="text-xl mb-1">Something went wrong! ノ( OωOノ)</h2>
|
||||
<Button onClick={() => reset()} className="cursor-pointer">
|
||||
Try again
|
||||
</Button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
15
app/not-found.tsx
Normal file
15
app/not-found.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import Button from 'components/rua/button';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<main className="flex-1 w-full max-w-4xl mx-auto flex items-center justify-center">
|
||||
<div>
|
||||
<h2 className="text-xl mb-1">来到了神秘次元 ∑( 口 ||)</h2>
|
||||
<Link href="/">
|
||||
<Button className="cursor-pointer">Home</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
@ -16,7 +16,6 @@ const PostToc = dynamic(() => import('components/post/post-toc'));
|
||||
const PostCommnetLine = dynamic(
|
||||
() => import('components/post/post-commnet-line'),
|
||||
);
|
||||
const PostComment = dynamic(() => import('components/post/post-comment'));
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return await allPostsPath();
|
||||
|
Reference in New Issue
Block a user