diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 0bee83f..77e4542 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -65,23 +65,15 @@ jobs: run: | python -m pip install -e .[formats] git config set versionsort.suffix -rc + export SANSMIC_SPHINX_VERSION=${{ github.ref_name }}@`git rev-parse --short HEAD` python build_docs.py mkdir docs/_build mkdir docs/_build/doxyxml sphinx-build -b html docs/ out/ - for TAG in `git tag --list --sort=-version:refname` + for TAG in `git tag --list "v*.*.*" --sort=-version:refname` do - python -m pip uninstall -y sansmic - rm -rf docs/_build/doxyxml docs/apidocs/* - export SANSMIC_SPHINX_VERSION=$TAG - export VERSION_INFO=$TAG - mkdir docs/_build/doxyxml - git checkout -f $TAG - if [ -f "docs/requirements.txt" ]; then - python -m pip install --force-reinstall -r docs/requirements.txt - fi - python -m pip install -e .[docs] - sphinx-build -Q -b html docs/ out/$TAG + git clone --depth=1 --tag=$TAG https://github.com/sandialabs/sansmic-docs.git out/$TAG + rm -rf ./out/$TAG/.git done - name: Upload artifact diff --git a/build_docs.py b/build_docs.py index 15d2784..86d2036 100644 --- a/build_docs.py +++ b/build_docs.py @@ -20,8 +20,8 @@ tags = git_tag.stdout.splitlines() versions = [ { - "name": "main", - "version": "main", + "name": os.environ.get("SANSMIC_SPHINX_VERSION", "main"), + "version": os.environ.get("SANSMIC_SPHINX_VERSION", "main"), "url": "https://sandialabs.github.io/sansmic/", "preferred": False, } diff --git a/docs/conf.py b/docs/conf.py index 3e9e6c5..bc4e469 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -209,7 +209,6 @@ ############################################################################## # Builder options # ############################################################################## - # -- Options for HTML output ------------------------------------------------- html_theme = "pydata_sphinx_theme" html_static_path = ["_static"] @@ -218,10 +217,6 @@ ] # html_sidebars = {"nomenclature": []} html_theme_options = { - "logo": { - "image_light": "_static/logo-light.png", - "image_dark": "_static/logo-dark.png", - }, "icon_links": [ { "name": "GitHub", # Label for this link @@ -248,7 +243,9 @@ "show_toc_level": 2, "switcher": { "json_url": "https://sandialabs.github.io/sansmic/_static/switcher.json", - "version_match": version, + "version_match": "v" + version + if len(version) > 0 and version[0].isdigit() + else version, }, # "secondary_sidebar_items": ["page-toc"], #["page-toc", "edit-this-page", "sourcelink"], "navbar_start": [