Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# Retrieve the version number from git via setuptools_scm
called_proc = subprocess.run('python -m setuptools_scm', shell=True, capture_output=True, check=True)
release = called_proc.stdout.strip().decode('utf-8')
version = '.'.join(release.split('.')[:3])
version = '.'.join(release.split('.')[:2])

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -171,7 +171,10 @@
# documentation.

html_logo = '_static/main_nv_logo_square.png'
html_title = f'{project} ({version})'

# Setting check_switcher to False, since we are building the version switcher for the first time, the json_url will
# return 404s, which will then cause the build to fail.
html_theme_options = {
'collapse_navigation': False,
'navigation_depth': 6,
Expand All @@ -185,9 +188,15 @@
<script type="text/javascript">if (typeof _satellite !== "undefined") {_satellite.pageBottom();}</script>
'''
],
"show_nav_level": 2
"show_nav_level": 2,
"switcher": {
"json_url": "../versions1.json", "version_match": version
},
"check_switcher": False
}

html_extra_path = ["versions1.json"]

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down
15 changes: 15 additions & 0 deletions docs/source/versions1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"preferred": true,
"version": "1.2",
"url": "../1.2/"
},
{
"version": "1.1",
"url": "../1.1/"
},
{
"version": "1.0",
"url": "../1.0/"
}
]