Skip to content

Deploy docs site with Hugo via GitHub Actions#303

Open
oschwald wants to merge 3 commits into
mainfrom
greg/stf-448
Open

Deploy docs site with Hugo via GitHub Actions#303
oschwald wants to merge 3 commits into
mainfrom
greg/stf-448

Conversation

@oschwald
Copy link
Copy Markdown
Member

Summary

Migrates the Pages index from Jekyll on gh-pages to a Hugo build that
publishes back onto gh-pages from GitHub Actions. All CSS is now
inlined in the layout template — no external CDN dependencies.

  • Hugo site lives under docs/ on main and mounts README.md as the
    home page
  • A small pill nav links from the overview to the phpDocumentor output
    at /doc/latest/
  • .github/workflows/pages.yml builds with mise run build-docs and
    pushes to gh-pages via peaceiris/actions-gh-pages with
    keep_files: true, so every /doc/vX.Y.Z/ subtree stays untouched
  • dev-bin/release.sh no longer regenerates the Jekyll index.md;
    the phpDocumentor-publishing block is unchanged

Same design as MaxMind-DB PR #221.

For STF-448.

Post-merge steps

  1. Verify the live site at https://maxmind.github.io/GeoIP2-php/ and
    a sample /doc/latest/ still loads after the next workflow run
  2. In a separate commit on gh-pages, drop the legacy Jekyll source
    files

Pages source stays on gh-pages — no Terraform change for this repo.

Test plan

  • mise run build-docs succeeds with no warnings
  • Rendered <title>, <h1>, and pill nav are correct
  • No static-gh.maxmind.com references in the new site
  • Build job passes in CI (push step only runs on main)
  • After merge, confirm the workflow pushes successfully to gh-pages
    and /doc/vX.Y.Z/ subtrees are preserved

🤖 Generated with Claude Code

oschwald and others added 3 commits May 15, 2026 22:44
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>
Deploys the Hugo docs site on push to main. The workflow builds the
site with `mise run build-docs` and pushes the rendered output onto
the existing `gh-pages` branch with `keep_files: true` — that
preserves every `/doc/vX.Y.Z/` phpDocumentor subtree exactly as the
release script publishes them. Pages keeps deploying from `gh-pages`,
so no Terraform change is needed for this repo.

All actions are SHA-pinned.

For STF-448.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Hugo on `main` now owns the Pages index, so the release script no
longer needs to write a Jekyll front-matter wrapper around README.md
on the gh-pages branch. The phpDocumentor block that builds and
publishes `doc/$tag/` is unchanged — that versioned tree continues to
live on gh-pages and is preserved by the new workflow's
`keep_files: true`.

For STF-448.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions the documentation generation from a manual shell script process to a Hugo-based static site generator. It introduces Hugo configuration, layouts, and mise for tool management. Feedback suggests improving internationalization (i18n) by using site-configured language codes and translation functions instead of hardcoded strings in the HTML templates.

@@ -0,0 +1,207 @@
<!doctype html>
<html lang="en">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The lang attribute is hardcoded to en. For better accessibility and to support future internationalization (i18n), it is recommended to use the site's configured language code.

Suggested change
<html lang="en">
<html lang="{{ .Site.LanguageCode | default "en" }}">

Comment on lines +200 to +201
<a href="{{ .Site.Home.RelPermalink }}"{{ if .IsHome }} class="active"{{ end }}>Overview</a>
<a href="{{ "doc/latest/" | relURL }}">API documentation</a>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The navigation labels are hardcoded. Following internationalization (i18n) best practices, these strings should be externalized using Hugo's translation features to allow for easier localization in the future.

Suggested change
<a href="{{ .Site.Home.RelPermalink }}"{{ if .IsHome }} class="active"{{ end }}>Overview</a>
<a href="{{ "doc/latest/" | relURL }}">API documentation</a>
<a href="{{ .Site.Home.RelPermalink }}"{{ if .IsHome }} class="active"{{ end }}>{{ T "overview" | default "Overview" }}</a>
<a href="{{ "doc/latest/" | relURL }}">{{ T "api_documentation" | default "API documentation" }}</a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant