返回 CodeWhale
not-found.tsx
根目录 / web / app / [locale] / not-found.tsx
1 import type { Metadata } from "next";
2 import { NotFoundRoute } from "@/components/route-state";
3
4 // A not-found boundary receives no params, so the title is locale-neutral;
5 // without it the 404 would carry the home page's <title>. The rest of the
6 // object replaces — not extends — the inherited home metadata: a 404 must
7 // not advertise the home page as its canonical, hreflang, or share target.
8 export const metadata: Metadata = {
9 title: "Not found · Codewhale",
10 robots: { index: false, follow: true },
11 alternates: {},
12 openGraph: { title: "Not found · Codewhale" },
13 };
14
15 /**
16 * Not-found boundary inside the locale shell, so a `notFound()` thrown by
17 * any locale page renders with the site's nav, footer, and dictionary copy
18 * instead of the framework's bare page.
19 */
20 export default function NotFound() {
21 return (
22 <div className="route-state">
23 <NotFoundRoute />
24 </div>
25 );
26 }
27
27 lines Plain Text