Skip to content

Publish ref docs to GitHub Pages with versioning and version picker#341

Merged
kirre-bylund merged 3 commits into
devfrom
task/1465-publish-ref-docs-to-gh-pages
May 15, 2026
Merged

Publish ref docs to GitHub Pages with versioning and version picker#341
kirre-bylund merged 3 commits into
devfrom
task/1465-publish-ref-docs-to-gh-pages

Conversation

@kirre-bylund
Copy link
Copy Markdown
Contributor

Part of lootlocker/index#1465.

What this does

Adds GitHub Pages deployment to the existing generate-docs.yml workflow so reference docs are publicly hosted at a stable URL, with full version history.

New: deploy-pages job

  • Runs on push to main, release (published), and workflow_dispatchnot on PRs
  • Deploys Doxygen HTML to the gh-pages branch:
    • latest/ — updated on every push to main / dispatch
    • v<tag>/ — additionally deployed on release events
  • Maintains versions.json at the site root (semver-sorted descending, latest always first) so the version picker can discover all published versions
  • Writes a root index.html that meta-redirects to latest/

New: version-picker.js

  • Loaded via <script defer> in header.html
  • On page load: fetches versions.json from the site root, replaces the static #ll-topnav-version span with a <select> dropdown
  • Preserves the current page filename when switching versions (best-effort)
  • Graceful no-op fallback when versions.json is absent (local builds — existing static badge is kept as-is)

CSS + Doxyfile

  • lootlocker-theme.css: extends the existing #ll-topnav-version rule to also style #ll-version-picker; adds <select>-specific resets and hover/focus styles
  • Doxyfile: adds version-picker.js to HTML_EXTRA_FILES

After merging

A repo admin needs to enable GitHub Pages in Settings → Pages:

  • Source: branch gh-pages / / (root)
  • No custom domain

Then trigger a workflow_dispatch on main to populate latest/ for the first time. The backend team will subsequently proxy ref.lootlocker.com/unreal/* → the Pages URL.

Files changed

File Change
.github/workflows/generate-docs.yml Add push trigger; add deploy-pages job
.doxygen/version-picker.js New — version dropdown JS
.doxygen/Doxyfile Add version-picker.js to HTML_EXTRA_FILES
.doxygen/header.html Add <script defer> for version-picker.js
.doxygen/lootlocker-theme.css Add <select> styles for version picker

- Add push-to-main trigger to generate-docs.yml so latest/ auto-deploys on merge
- Add deploy-pages job: deploys docs to gh-pages branch under latest/ (every
  push to main) and under the release tag (e.g. v2.5.0/) on release events
- Maintain versions.json at the site root; sorted semver descending with
  latest always first
- Add root index.html that meta-redirects to latest/
- Add version-picker.js: fetches versions.json and replaces the static
  #ll-topnav-version badge with a <select> dropdown for navigating between
  published versions; gracefully falls back to static badge when
  versions.json is unavailable (local builds)
- Register version-picker.js in Doxyfile HTML_EXTRA_FILES
- Load version-picker.js in header.html via <script defer>
- Add <select> styles to lootlocker-theme.css matching the existing nav badge

Part of lootlocker/index#1465
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the existing Doxygen reference-doc generation pipeline to publish versioned docs to GitHub Pages (via gh-pages) and adds a client-side version picker in the generated HTML so users can switch between published doc versions.

Changes:

  • Adds a deploy-pages job intended to publish generated docs to gh-pages and maintain a versions.json index plus a root redirect page.
  • Introduces a version-picker.js script and wires it into the Doxygen HTML header to replace the static version badge with a <select> populated from versions.json.
  • Updates Doxygen config/CSS to ship and style the version picker assets.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.github/workflows/generate-docs.yml Adds a Pages deployment job, generates versions.json, and publishes versioned directories to gh-pages.
.doxygen/version-picker.js Implements the client-side version dropdown by fetching versions.json and navigating between versions.
.doxygen/Doxyfile Includes version-picker.js as an extra HTML asset in the Doxygen output.
.doxygen/header.html Loads version-picker.js via a deferred script tag.
.doxygen/lootlocker-theme.css Styles the version picker to match the existing top navigation theme.

Comment thread .github/workflows/generate-docs.yml
Comment thread .github/workflows/generate-docs.yml
Comment thread .github/workflows/generate-docs.yml Outdated
Comment thread .github/workflows/generate-docs.yml
Comment thread .doxygen/version-picker.js Outdated
Comment thread .doxygen/version-picker.js
… dir URLs, hash preservation; fix dispatch-on-main to deploy latest/
@kirre-bylund kirre-bylund merged commit e8a3dd0 into dev May 15, 2026
1 check passed
@kirre-bylund kirre-bylund deleted the task/1465-publish-ref-docs-to-gh-pages branch May 15, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants