Skip to content

Add versioned docs support via separate gh-pages repo #299

Description

@sibocw

Background

The current docs publishing workflow (scripts/dev/push_doc_site.sh) builds the site with properdocs build and force-pushes it as a single-commit orphan to the gh-pages branch. This works well and keeps the repo lean, but it only supports one version at a time.

Goal

Support multiple doc versions (e.g. v2.0, v2.1) with a version-switcher in the Material theme, without bloating the main flygym repo with large binary assets (STL meshes, MuJoCo WASM, Three.js).

Chosen approach: separate GitHub repository for gh-pages

Create a dedicated repo (e.g. NeLy-EPFL/flygym-docs) to serve GitHub Pages. Key points:

  • The main flygym repo is never touched by doc deployments — clone size stays lean
  • Use mike for versioned deploys: mike deploy --push --update-aliases <version> latest
  • mike incrementally commits per-version subdirectories to the docs repo's gh-pages branch; history accumulates there but it's isolated
  • The Material theme version-switcher reads a versions.json that mike maintains automatically
  • The manual deploy workflow (push_doc_site.sh) stays in control — mike is just a CLI call that replaces the current git-init/force-push block

What needs to change

  1. Create NeLy-EPFL/flygym-docs (or similar), enable GitHub Pages on it
  2. Move the CNAME (neuromechfly.org) to the new repo — DNS is unchanged
  3. In push_doc_site.sh, replace the manual git-init/force-push block (~10 lines) with mike deploy --push [--update-aliases <version> latest] <version>, pointing at the new repo's remote
  4. Add a few lines to properdocs.yml to enable the Material version-switcher (extra.version.provider: mike)
  5. Add mike to dev dependencies

Notes

  • The version is read automatically from pyproject.toml. The script then prompts:
    1. Confirm or override the version label (allows entering e.g. 2.1.1 (dev) freely)
    2. Whether to update the latest alias (answer n for dev/pre-release deploys)
  • WASM mesh assets (wasm/viewer/assets/, wasm/game/assets/) only need to be regenerated when the fly model or viewer/game config changes — not on every deploy. The script already handles this correctly.
  • The manual pre-deploy checks (notebook state, local preview) are fully preserved.
  • The first deploy needs a clean start on the new repo (no migration of the existing unversioned gh-pages content needed).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions