Skip to content

Commit 8486107

Browse files
committed
Add a branded 404 page
Unknown URLs currently land on the unbranded Next.js default 404 (a bare 'This page could not be found'). With the static export, a root app/not-found.tsx is emitted as out/404.html, which GitHub Pages serves for any unknown path. The new page matches the site's dark styling and routes visitors to the places a lost visitor most likely wants: docs, downloads, samples, home, and an issue link for reporting broken links.
1 parent dd4e786 commit 8486107

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

‎app/not-found.tsx‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import Link from "next/link";
2+
3+
const suggestions = [
4+
{
5+
title: "Documentation",
6+
description: "Guides, quick starts, and the MQL reference.",
7+
href: "/docs",
8+
},
9+
{
10+
title: "Download",
11+
description: "Docker, APT, and RPM install commands.",
12+
href: "/packages",
13+
},
14+
{
15+
title: "Samples",
16+
description: "Ready-to-run example applications.",
17+
href: "/samples",
18+
},
19+
] as const;
20+
21+
export default function NotFound() {
22+
return (
23+
<div className="flex min-h-screen flex-col items-center justify-center bg-neutral-900 px-4 py-16 sm:px-6">
24+
<p className="mb-3 text-xs font-semibold uppercase tracking-[0.24em] text-blue-300">
25+
404 - Page not found
26+
</p>
27+
<h1 className="mb-4 text-center text-4xl font-extrabold tracking-tight text-white sm:text-5xl">
28+
This page doesn&apos;t exist
29+
</h1>
30+
<p className="mb-10 max-w-xl text-center text-base leading-7 text-gray-400">
31+
The page you&apos;re looking for may have moved. These are the most
32+
useful places to continue from.
33+
</p>
34+
35+
<div className="mb-10 grid w-full max-w-3xl gap-4 sm:grid-cols-3">
36+
{suggestions.map((item) => (
37+
<Link
38+
key={item.href}
39+
href={item.href}
40+
className="group rounded-2xl border border-neutral-800 bg-neutral-900/80 p-5 transition hover:-translate-y-0.5 hover:border-blue-400/30 hover:bg-neutral-800/60"
41+
>
42+
<h2 className="mb-2 text-lg font-semibold text-white transition group-hover:text-blue-200">
43+
{item.title}
44+
</h2>
45+
<p className="text-sm leading-6 text-gray-400">{item.description}</p>
46+
</Link>
47+
))}
48+
</div>
49+
50+
<div className="flex flex-col gap-3 sm:flex-row">
51+
<Link
52+
href="/"
53+
className="inline-flex items-center justify-center rounded-md bg-blue-500 px-6 py-3 text-sm font-semibold text-white transition-colors hover:bg-blue-400"
54+
>
55+
Back to home
56+
</Link>
57+
<a
58+
href="https://github.com/documentdb/documentdb.github.io/issues"
59+
target="_blank"
60+
rel="noopener noreferrer"
61+
className="inline-flex items-center justify-center rounded-md border border-neutral-600 bg-neutral-800/40 px-6 py-3 text-sm font-semibold text-gray-200 transition-colors hover:border-neutral-500 hover:bg-neutral-800"
62+
>
63+
Report a broken link
64+
</a>
65+
</div>
66+
</div>
67+
);
68+
}

0 commit comments

Comments
 (0)