From afdf4e2973902d88b7d56328769633636c41a8f7 Mon Sep 17 00:00:00 2001 From: niksirbi Date: Wed, 12 Nov 2025 18:28:28 +0000 Subject: [PATCH 1/3] adapt conf.py and docs CI worflow for multi-version docs --- .github/workflows/docs_build_and_deploy.yml | 9 +++++++-- docs/source/conf.py | 9 ++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs_build_and_deploy.yml b/.github/workflows/docs_build_and_deploy.yml index ce46508a4..60e997955 100644 --- a/.github/workflows/docs_build_and_deploy.yml +++ b/.github/workflows/docs_build_and_deploy.yml @@ -33,9 +33,14 @@ jobs: needs: build_sphinx_docs permissions: contents: write - if: github.event_name == 'push' && github.ref_type == 'tag' + # runs on releases, push to main, or manual dispatch on main + if: | + (github.event_name == 'push' && github.ref_type == 'tag') || + (github.event_name == 'push' && github.ref == 'refs/heads/main') || + (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') runs-on: ubuntu-latest steps: - - uses: neuroinformatics-unit/actions/deploy_sphinx_docs@v2 + - uses: neuroinformatics-unit/actions/deploy_sphinx_docs_multiversion@main with: secret_input: ${{ secrets.GITHUB_TOKEN }} + switcher-url: https://datashuttle.neuroinformatics.dev/latest/_static/switcher.json diff --git a/docs/source/conf.py b/docs/source/conf.py index 2c6a5fcf3..296a07c21 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,12 +23,14 @@ # Retrieve the version number from the package try: release = setuptools_scm.get_version(root="../..", relative_to=__file__) - release = release.split(".dev")[0] # remove dev tag and git hash + release = release.split("+")[0] # remove git hash except LookupError: # if git is not initialised, still allow local build # with a dummy version release = "0.0.0" +doc_version = "dev" if "dev" in release else f"v{release}" + # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -148,6 +150,11 @@ "type": "fontawesome", }, ], + "switcher": { + "json_url": "https://datashuttle.neuroinformatics.dev/latest/_static/switcher.json", + "version_match": doc_version, + }, + "navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"], "logo": { "text": f"datashuttle v{release}", "image_light": "_static/logo_light.png", From 50e428784e932b36e6ebb9fc6c5eaaf174ff0020 Mon Sep 17 00:00:00 2001 From: niksirbi Date: Wed, 12 Nov 2025 18:32:16 +0000 Subject: [PATCH 2/3] Update install and get_started links in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2de20560b..bd5b5e6bb 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ **datashuttle** is a tool to automate creation, validation and transfer of neuroscience project folders. -Learn how to [Install](https://datashuttle.neuroinformatics.dev/pages/get_started/install.html) +Learn how to [Install](https://datashuttle.neuroinformatics.dev/latest/pages/get_started/install.html) and -[Get Started](https://datashuttle.neuroinformatics.dev/pages/get_started/index.html) +[Get Started](https://datashuttle.neuroinformatics.dev/latest/pages/get_started/index.html) on the [**datashuttle** website](https://datashuttle.neuroinformatics.dev). From da0f45cccdf63d50e649cc55a6e311150ae9670b Mon Sep 17 00:00:00 2001 From: niksirbi Date: Wed, 14 Jan 2026 13:47:09 +0000 Subject: [PATCH 3/3] use the stabler v2 version of docs actions --- .github/workflows/docs_build_and_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs_build_and_deploy.yml b/.github/workflows/docs_build_and_deploy.yml index 60e997955..607d2a5cd 100644 --- a/.github/workflows/docs_build_and_deploy.yml +++ b/.github/workflows/docs_build_and_deploy.yml @@ -24,7 +24,7 @@ jobs: name: Build Sphinx Docs runs-on: ubuntu-latest steps: - - uses: neuroinformatics-unit/actions/build_sphinx_docs@main + - uses: neuroinformatics-unit/actions/build_sphinx_docs@v2 with: use-artifactci: lazy @@ -40,7 +40,7 @@ jobs: (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') runs-on: ubuntu-latest steps: - - uses: neuroinformatics-unit/actions/deploy_sphinx_docs_multiversion@main + - uses: neuroinformatics-unit/actions/deploy_sphinx_docs_multiversion@v2 with: secret_input: ${{ secrets.GITHUB_TOKEN }} switcher-url: https://datashuttle.neuroinformatics.dev/latest/_static/switcher.json