Skip to content

Commit 40996b1

Browse files
oschwaldclaude
andcommitted
Add a 404 page layout
Hugo's built-in fallback renders an empty `<main></main>` for the 404 page. Provide a minimal "Page not found" body with a link back to the site home, reusing the Charter/forest-green design tokens from the main layout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4880af6 commit 40996b1

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

docs/layouts/404.html

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>Page not found | {{ .Site.Title }}</title>
7+
<style>
8+
:root {
9+
--fg: #2d2d2d;
10+
--bg: #faf9f7;
11+
--accent: #1a6b50;
12+
--heading: #1a1a1a;
13+
}
14+
15+
*,
16+
*::before,
17+
*::after {
18+
box-sizing: border-box;
19+
}
20+
21+
body {
22+
font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;
23+
font-size: 1.05rem;
24+
line-height: 1.78;
25+
color: var(--fg);
26+
background: var(--bg);
27+
max-width: 50rem;
28+
margin: 0 auto;
29+
padding: 3rem 1.5rem 5rem;
30+
}
31+
32+
h1 {
33+
font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial,
34+
sans-serif;
35+
font-size: 1.75rem;
36+
font-weight: 800;
37+
line-height: 1.35;
38+
color: var(--heading);
39+
margin: 0 0 1.5rem;
40+
padding-bottom: 0.75rem;
41+
border-bottom: 3px solid var(--accent);
42+
}
43+
44+
a {
45+
color: var(--accent);
46+
}
47+
</style>
48+
</head>
49+
<body>
50+
<main>
51+
<h1>Page not found</h1>
52+
<p>
53+
The page you're looking for doesn't exist. Return to
54+
<a href="{{ .Site.Home.RelPermalink }}">{{ .Site.Title }}</a>.
55+
</p>
56+
</main>
57+
</body>
58+
</html>

0 commit comments

Comments
 (0)