Skip to content

Commit 6eba050

Browse files
committed
Add versioning to docs
1 parent 699a219 commit 6eba050

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/deploy-docs.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@ jobs:
2828
# Install all documentation dependencies directly instead of using -e .[docs]
2929
pip install mkdocs-material mkdocstrings-python mkdocs-table-reader-plugin mkdocs-include-markdown-plugin mkdocs-gen-files mkdocs-literate-nav markdown-include pymdown-extensions pygments
3030
31-
- name: Deploy documentation
32-
run: mkdocs gh-deploy --force
31+
- name: Deploy docs
32+
run: |
33+
VERSION=${GITHUB_REF#refs/tags/v}
34+
mike deploy --push --update-aliases $VERSION latest

mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ theme:
5050
- content.code.annotate
5151
- content.tooltips
5252
- content.code.copy
53+
- navigation.footer.version
5354

5455
markdown_extensions:
5556
- admonition
@@ -83,6 +84,7 @@ plugins:
8384
- search # Enables the search functionality in the documentation
8485
- table-reader # Allows including tables from external files
8586
- include-markdown
87+
- mike
8688
- gen-files:
8789
scripts:
8890
- scripts/gen_ref_pages.py
@@ -120,6 +122,11 @@ plugins:
120122
extra:
121123
infer_type_annotations: true # Uses Python type hints to supplement docstring information
122124

125+
extra:
126+
version:
127+
provider: mike
128+
default: latest
129+
123130
extra_javascript:
124131
- javascripts/mathjax.js # Custom MathJax 3 CDN Configuration
125132
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js #MathJax 3 CDN

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ docs = [
6565
"mkdocs-literate-nav",
6666
"markdown-include",
6767
"pymdown-extensions",
68-
"pygments"
68+
"pygments",
69+
"mike",
6970
]
7071

7172
[project.urls]

0 commit comments

Comments
 (0)