Skip to content

Commit 4f9403c

Browse files
oschwaldclaude
andcommitted
Add Hugo-based spec site
Replace the stale gh-pages branch (5 years behind, broken CDN links) with a Hugo site built from the existing MaxMind-DB-spec.md. Zero external dependencies — all CSS is inlined in the template. Design: Charter serif body text, forest-green accents on field-name headings (node_count, record_size, etc.) with left-border + gradient for scannability, hover anchor links on all headings for deep linking. Build with `mise run build-docs`, preview with `mise run serve-docs`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 327e23a commit 4f9403c

File tree

5 files changed

+198
-1
lines changed

5 files changed

+198
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
/_site
1+
docs/.hugo_build.lock
2+
docs/public/
23
*.swp
34
/cmd/write-test-data/write-test-data

docs/hugo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
baseURL = "https://maxmind.github.io/MaxMind-DB/"
2+
title = "MaxMind DB"
3+
disableKinds = ["taxonomy"]
4+
5+
[markup.highlight]
6+
noClasses = true
7+
style = "github"
8+
9+
[[module.mounts]]
10+
source = "../MaxMind-DB-spec.md"
11+
target = "content/_index.md"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h{{ .Level }} id="{{ .Anchor }}">
2+
{{- .Text | safeHTML -}}
3+
<a class="heading-anchor" href="#{{ .Anchor }}" aria-label="Link to {{ .PlainText }}">#</a>
4+
</h{{ .Level }}>

docs/layouts/_default/default.html

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
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>{{ .Title }}</title>
7+
<style>
8+
:root {
9+
--fg: #2d2d2d;
10+
--bg: #faf9f7;
11+
--accent: #1a6b50;
12+
--accent-soft: rgba(26, 107, 80, 0.06);
13+
--border: #d5d0c8;
14+
--code-bg: #f0eeea;
15+
--heading: #1a1a1a;
16+
--muted: #70695f;
17+
}
18+
19+
::selection {
20+
background: rgba(26, 107, 80, 0.15);
21+
}
22+
23+
*,
24+
*::before,
25+
*::after {
26+
box-sizing: border-box;
27+
}
28+
29+
body {
30+
font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;
31+
font-size: 1.05rem;
32+
line-height: 1.78;
33+
color: var(--fg);
34+
background: var(--bg);
35+
max-width: 50rem;
36+
margin: 0 auto;
37+
padding: 3rem 1.5rem 5rem;
38+
}
39+
40+
h1,
41+
h2,
42+
h3,
43+
h4 {
44+
font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial,
45+
sans-serif;
46+
line-height: 1.35;
47+
}
48+
49+
h1 {
50+
font-size: 1.75rem;
51+
font-weight: 800;
52+
color: var(--heading);
53+
margin: 0 0 1.5rem;
54+
padding-bottom: 0.75rem;
55+
border-bottom: 3px solid var(--accent);
56+
}
57+
58+
h2 {
59+
font-size: 1.3rem;
60+
font-weight: 700;
61+
color: var(--heading);
62+
margin: 3rem 0 0.75rem;
63+
padding-bottom: 0.4rem;
64+
border-bottom: 1px solid var(--border);
65+
}
66+
67+
h3 {
68+
font-size: 1.05rem;
69+
font-weight: 700;
70+
color: var(--accent);
71+
margin: 2.5rem 0 0.5rem;
72+
padding: 0.4rem 0.75rem;
73+
border-left: 3px solid var(--accent);
74+
background: linear-gradient(
75+
135deg,
76+
var(--accent-soft),
77+
transparent 80%
78+
);
79+
border-radius: 0 3px 3px 0;
80+
}
81+
82+
h4 {
83+
font-size: 0.92rem;
84+
font-weight: 700;
85+
color: var(--muted);
86+
margin: 2rem 0 0.5rem;
87+
padding-bottom: 0.2rem;
88+
border-bottom: 1px dashed var(--border);
89+
}
90+
91+
p {
92+
margin: 0.8rem 0;
93+
}
94+
95+
a {
96+
color: var(--accent);
97+
text-decoration-thickness: 1px;
98+
text-underline-offset: 2px;
99+
transition: text-decoration-thickness 0.15s;
100+
}
101+
102+
a:hover {
103+
text-decoration-thickness: 2px;
104+
}
105+
106+
strong {
107+
color: var(--heading);
108+
font-weight: 700;
109+
}
110+
111+
ol,
112+
ul {
113+
padding-left: 1.75rem;
114+
}
115+
116+
li + li {
117+
margin-top: 0.3rem;
118+
}
119+
120+
code {
121+
font-family: "JetBrains Mono", "Cascadia Code", Menlo, Consolas,
122+
monospace;
123+
font-size: 0.88em;
124+
background: var(--code-bg);
125+
padding: 0.15em 0.4em;
126+
border-radius: 3px;
127+
border: 1px solid rgba(0, 0, 0, 0.06);
128+
}
129+
130+
pre {
131+
background: var(--code-bg);
132+
border: 1px solid var(--border);
133+
border-radius: 5px;
134+
padding: 1rem 1.25rem;
135+
overflow-x: auto;
136+
line-height: 1.55;
137+
}
138+
139+
pre code {
140+
background: none;
141+
padding: 0;
142+
border: none;
143+
font-size: 0.85em;
144+
}
145+
146+
.heading-anchor {
147+
opacity: 0;
148+
margin-left: 0.3em;
149+
font-weight: 400;
150+
text-decoration: none;
151+
transition: opacity 0.15s;
152+
}
153+
154+
h1:hover .heading-anchor,
155+
h2:hover .heading-anchor,
156+
h3:hover .heading-anchor,
157+
h4:hover .heading-anchor,
158+
.heading-anchor:focus {
159+
opacity: 0.4;
160+
}
161+
162+
.heading-anchor:hover {
163+
opacity: 1;
164+
}
165+
</style>
166+
</head>
167+
<body>
168+
<main>
169+
{{ .Content }}
170+
</main>
171+
</body>
172+
</html>

mise.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
[tools]
22
go = "latest"
3+
hugo = "latest"
34
node = "latest"
45
golangci-lint = "latest"
56
"github:houseabsolute/precious" = "latest"
67
"npm:prettier" = "latest"
8+
9+
[tasks.build-docs]
10+
description = "Build the spec site with Hugo"
11+
run = "hugo --source docs --minify"
12+
13+
[tasks.serve-docs]
14+
description = "Serve the spec site locally with Hugo dev server"
15+
run = "hugo server --source docs"

0 commit comments

Comments
 (0)