Skip to content

Commit 536f8f2

Browse files
oschwaldclaude
andcommitted
Add Hugo-based docs site
Build with `mise run build-docs`, preview with `mise run serve-docs`. The site mounts the existing `README.md` as the home page so the source of truth stays in one place. A small pill nav links from Overview to the versioned API documentation that lives on the `gh-pages` branch under `doc/latest/`. CSS is inlined in the layout template — no external dependencies. Same Charter serif + forest-green design as the MaxMind-DB spec site. For STF-448. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c142c31 commit 536f8f2

6 files changed

Lines changed: 272 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
.claude
1010
.gh-pages
1111
.idea
12+
docs/.hugo_build.lock
13+
docs/public/
1214
.pmd
1315
.project
1416
.settings

docs/hugo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
title = "GeoIP2 Java API"
2+
disableKinds = ["taxonomy"]
3+
4+
[[cascade]]
5+
layout = "default"
6+
7+
[markup.highlight]
8+
noClasses = true
9+
style = "github"
10+
11+
[[module.mounts]]
12+
source = "../README.md"
13+
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: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
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>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ or .Title .File.BaseFileName }} | {{ .Site.Title }}{{ end }}</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+
img {
147+
max-width: 100%;
148+
height: auto;
149+
}
150+
151+
.heading-anchor {
152+
opacity: 0;
153+
margin-left: 0.3em;
154+
font-weight: 400;
155+
text-decoration: none;
156+
transition: opacity 0.15s;
157+
}
158+
159+
h1:hover .heading-anchor,
160+
h2:hover .heading-anchor,
161+
h3:hover .heading-anchor,
162+
h4:hover .heading-anchor,
163+
.heading-anchor:focus {
164+
opacity: 0.4;
165+
}
166+
167+
.heading-anchor:hover {
168+
opacity: 1;
169+
}
170+
171+
.page-nav {
172+
margin-bottom: 2.5rem;
173+
display: flex;
174+
gap: 0.5rem;
175+
flex-wrap: wrap;
176+
}
177+
178+
.page-nav a {
179+
font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial,
180+
sans-serif;
181+
font-size: 0.85rem;
182+
font-weight: 600;
183+
text-decoration: none;
184+
color: var(--muted);
185+
padding: 0.3rem 0.75rem;
186+
border: 1px solid var(--border);
187+
border-radius: 999px;
188+
transition: color 0.15s, border-color 0.15s, background 0.15s;
189+
}
190+
191+
.page-nav a:hover {
192+
color: var(--accent);
193+
border-color: var(--accent);
194+
}
195+
196+
.page-nav a.active {
197+
color: var(--bg);
198+
background: var(--accent);
199+
border-color: var(--accent);
200+
}
201+
</style>
202+
</head>
203+
<body>
204+
<nav class="page-nav">
205+
<a href="{{ .Site.Home.RelPermalink }}"{{ if .IsHome }} class="active" aria-current="page"{{ end }}>Overview</a>
206+
<a href="{{ "doc/latest/" | relURL }}">API documentation</a>
207+
</nav>
208+
<main>
209+
{{ .Content }}
210+
</main>
211+
</body>
212+
</html>

mise.lock

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mise.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,18 @@ disable_backends = [
77
]
88

99
[tools]
10+
hugo = "latest"
1011
java = "latest"
1112
maven = "latest"
1213

14+
[tasks.build-docs]
15+
description = "Build the docs site with Hugo"
16+
run = "hugo --source docs --minify"
17+
18+
[tasks.serve-docs]
19+
description = "Serve the docs site locally with Hugo dev server"
20+
run = "hugo server --source docs"
21+
1322
[hooks]
1423
enter = "mise install --quiet --locked"
1524

0 commit comments

Comments
 (0)