-
Notifications
You must be signed in to change notification settings - Fork 8
Deploy docs site with Hugo via GitHub Actions #628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ed57a03
0b8e7bc
9e15cfb
13ba8d3
d2d6fce
6190636
76f1d76
a92c533
278b689
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Deploy to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build-and-deploy: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup mise | ||
| uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 | ||
| with: | ||
| cache: true | ||
|
|
||
| - name: Build docs | ||
| env: | ||
| HUGO_BASEURL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/ | ||
| run: mise run build-docs | ||
|
|
||
| - name: Push rendered site to gh-pages | ||
| uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./docs/public | ||
| publish_branch: gh-pages | ||
| keep_files: true | ||
| user_name: "github-actions[bot]" | ||
| user_email: "41898282+github-actions[bot]@users.noreply.github.com" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ | |
| .claude | ||
| .gh-pages | ||
| .idea | ||
| docs/.hugo_build.lock | ||
| docs/public/ | ||
| .pmd | ||
| .project | ||
| .settings | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| :root { | ||
| --fg: #2d2d2d; | ||
| --bg: #faf9f7; | ||
| --accent: #1a6b50; | ||
| --accent-soft: rgba(26, 107, 80, 0.06); | ||
| --border: #d5d0c8; | ||
| --code-bg: #f0eeea; | ||
| --heading: #1a1a1a; | ||
| --muted: #70695f; | ||
| } | ||
|
|
||
| ::selection { | ||
| background: rgba(26, 107, 80, 0.15); | ||
| } | ||
|
|
||
| *, | ||
| *::before, | ||
| *::after { | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| body { | ||
| font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif; | ||
| font-size: 1.05rem; | ||
| line-height: 1.78; | ||
| color: var(--fg); | ||
| background: var(--bg); | ||
| max-width: 50rem; | ||
| margin: 0 auto; | ||
| padding: 3rem 1.5rem 5rem; | ||
| } | ||
|
|
||
| h1, | ||
| h2, | ||
| h3, | ||
| h4 { | ||
| font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; | ||
| line-height: 1.35; | ||
| } | ||
|
|
||
| h1 { | ||
| font-size: 1.75rem; | ||
| font-weight: 800; | ||
| color: var(--heading); | ||
| margin: 0 0 1.5rem; | ||
| padding-bottom: 0.75rem; | ||
| border-bottom: 3px solid var(--accent); | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 1.3rem; | ||
| font-weight: 700; | ||
| color: var(--heading); | ||
| margin: 3rem 0 0.75rem; | ||
| padding-bottom: 0.4rem; | ||
| border-bottom: 1px solid var(--border); | ||
| } | ||
|
|
||
| h3 { | ||
| font-size: 1.05rem; | ||
| font-weight: 700; | ||
| color: var(--accent); | ||
| margin: 2.5rem 0 0.5rem; | ||
| padding: 0.4rem 0.75rem; | ||
| border-left: 3px solid var(--accent); | ||
| background: linear-gradient(135deg, var(--accent-soft), transparent 80%); | ||
| border-radius: 0 3px 3px 0; | ||
| } | ||
|
|
||
| h4 { | ||
| font-size: 0.92rem; | ||
| font-weight: 700; | ||
| color: var(--muted); | ||
| margin: 2rem 0 0.5rem; | ||
| padding-bottom: 0.2rem; | ||
| border-bottom: 1px dashed var(--border); | ||
| } | ||
|
|
||
| p { | ||
| margin: 0.8rem 0; | ||
| } | ||
|
|
||
| a { | ||
| color: var(--accent); | ||
| text-decoration-thickness: 1px; | ||
| text-underline-offset: 2px; | ||
| transition: text-decoration-thickness 0.15s; | ||
| } | ||
|
|
||
| a:hover { | ||
| text-decoration-thickness: 2px; | ||
| } | ||
|
|
||
| strong { | ||
| color: var(--heading); | ||
| font-weight: 700; | ||
| } | ||
|
|
||
| ol, | ||
| ul { | ||
| padding-left: 1.75rem; | ||
| } | ||
|
|
||
| li + li { | ||
| margin-top: 0.3rem; | ||
| } | ||
|
|
||
| code { | ||
| font-family: "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace; | ||
| font-size: 0.88em; | ||
| background: var(--code-bg); | ||
| padding: 0.15em 0.4em; | ||
| border-radius: 3px; | ||
| border: 1px solid rgba(0, 0, 0, 0.06); | ||
| } | ||
|
|
||
| pre { | ||
| background: var(--code-bg); | ||
| border: 1px solid var(--border); | ||
| border-radius: 5px; | ||
| padding: 1rem 1.25rem; | ||
| overflow-x: auto; | ||
| line-height: 1.55; | ||
| } | ||
|
|
||
| pre code { | ||
| background: none; | ||
| padding: 0; | ||
| border: none; | ||
| font-size: 0.85em; | ||
| } | ||
|
|
||
| img { | ||
| max-width: 100%; | ||
| height: auto; | ||
| } | ||
|
|
||
| .heading-anchor { | ||
| opacity: 0; | ||
| margin-left: 0.3em; | ||
| font-weight: 400; | ||
| text-decoration: none; | ||
| transition: opacity 0.15s; | ||
| } | ||
|
|
||
| h1:hover .heading-anchor, | ||
| h2:hover .heading-anchor, | ||
| h3:hover .heading-anchor, | ||
| h4:hover .heading-anchor, | ||
| .heading-anchor:focus { | ||
| opacity: 0.4; | ||
| } | ||
|
|
||
| .heading-anchor:hover { | ||
| opacity: 1; | ||
| } | ||
|
|
||
| .page-nav { | ||
| margin-bottom: 2.5rem; | ||
| display: flex; | ||
| gap: 0.5rem; | ||
| flex-wrap: wrap; | ||
| } | ||
|
|
||
| .page-nav a { | ||
| font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; | ||
| font-size: 0.85rem; | ||
| font-weight: 600; | ||
| text-decoration: none; | ||
| color: var(--muted); | ||
| padding: 0.3rem 0.75rem; | ||
| border: 1px solid var(--border); | ||
| border-radius: 999px; | ||
| transition: | ||
| color 0.15s, | ||
| border-color 0.15s, | ||
| background 0.15s; | ||
| } | ||
|
|
||
| .page-nav a:hover { | ||
| color: var(--accent); | ||
| border-color: var(--accent); | ||
| } | ||
|
|
||
| .page-nav a.active { | ||
| color: var(--bg); | ||
| background: var(--accent); | ||
| border-color: var(--accent); | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,13 @@ | ||||||||||||||
| title = "MaxMind minFraud Java API" | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(Claude, responding on behalf of @oschwald.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(Claude, responding on behalf of @oschwald.) |
||||||||||||||
| disableKinds = ["taxonomy", "term", "RSS"] | ||||||||||||||
|
|
||||||||||||||
| [[cascade]] | ||||||||||||||
| layout = "default" | ||||||||||||||
|
|
||||||||||||||
| [markup.highlight] | ||||||||||||||
| noClasses = true | ||||||||||||||
| style = "github" | ||||||||||||||
|
|
||||||||||||||
| [[module.mounts]] | ||||||||||||||
| source = "../README.md" | ||||||||||||||
| target = "content/_index.md" | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <title>Page not found | {{ .Site.Title }}</title> | ||
| {{- $css := resources.Get "css/main.css" | fingerprint -}} | ||
| <link | ||
| rel="stylesheet" | ||
| href="{{ $css.RelPermalink }}" | ||
| integrity="{{ $css.Data.Integrity }}" | ||
| crossorigin="anonymous" | ||
| /> | ||
| </head> | ||
| <body> | ||
| <main> | ||
| <h1>Page not found</h1> | ||
| <p> | ||
| The page you're looking for doesn't exist. Return to | ||
| <a href="{{ .Site.Home.RelPermalink }}">{{ .Site.Title }}</a>. | ||
| </p> | ||
| </main> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <h{{ .Level }} id="{{ .Anchor }}"> | ||
| {{- .Text | safeHTML -}} | ||
| <a class="heading-anchor" href="#{{ .Anchor }}" aria-label="Link to {{ .PlainText }}">#</a> | ||
| </h{{ .Level }}> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| {{- $title := or .Title .File.BaseFileName -}} | ||
| <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ $title }} | {{ .Site.Title }}{{ end }}</title> | ||
| {{- $css := resources.Get "css/main.css" | fingerprint -}} | ||
| <link | ||
| rel="stylesheet" | ||
| href="{{ $css.RelPermalink }}" | ||
| integrity="{{ $css.Data.Integrity }}" | ||
| crossorigin="anonymous" | ||
| /> | ||
| </head> | ||
| <body> | ||
| <nav class="page-nav"> | ||
| <a href="{{ .Site.Home.RelPermalink }}"{{ if .IsHome }} class="active" aria-current="page"{{ end }}>Overview</a> | ||
| <a href="{{ "doc/latest/" | relURL }}">API documentation</a> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From Claude, seems right:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| </nav> | ||
| <main> | ||
| {{ .Content }} | ||
| </main> | ||
| </body> | ||
| </html> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Claude, not sure:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as on the GeoIP2-java and MaxMind-DB-Reader-java PRs: deferred to post-merge, captured on the Linear STF-448 cleanup checklist. The cleanup runs once after the Hugo workflow has populated each
gh-pageswith new content so the site isn't briefly empty.(Claude, responding on behalf of @oschwald.)