Skip to content

Commit aec4a47

Browse files
brabojclaude
andcommitted
feat: add custom 404 page
Branded error page with header, footer, and link back to tutorial home. Includes noindex meta tag and dark mode support. Closes #212 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 79b31df commit aec4a47

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

astro-site/src/pages/404.astro

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
import "../styles/global.css";
3+
import Header from "../components/Header.astro";
4+
import Footer from "../components/Footer.astro";
5+
import site from "../data/site.json";
6+
7+
const base = import.meta.env.BASE_URL;
8+
---
9+
10+
<!doctype html>
11+
<html lang="en">
12+
<head>
13+
<meta charset="utf-8" />
14+
<meta name="viewport" content="width=device-width, initial-scale=1" />
15+
<title>Page Not Found — {site.title}</title>
16+
<meta name="robots" content="noindex" />
17+
<script is:inline>
18+
document.documentElement.setAttribute(
19+
"data-theme",
20+
localStorage.getItem("theme") || "light"
21+
);
22+
</script>
23+
</head>
24+
<body>
25+
<Header currentPath="/" />
26+
<main class="content" style="text-align: center; padding: 4rem 1rem;">
27+
<h1>404 — Page Not Found</h1>
28+
<p style="margin: 1rem 0 2rem; color: var(--color-fg-muted);">
29+
The page you're looking for doesn't exist or has been moved.
30+
</p>
31+
<a href={base} style="color: var(--color-link);">Back to the tutorial</a>
32+
</main>
33+
<Footer />
34+
</body>
35+
</html>

0 commit comments

Comments
 (0)