Skip to content

Commit

Permalink
Merge pull request Unidata#3419 from dopplershift/doc-maint-branch
Browse files Browse the repository at this point in the history
Fix version for docs on maintenance branch
  • Loading branch information
dcamron authored Mar 6, 2024
2 parents 7254801 + af8838a commit ccaf509
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ runs:
- name: Build docs
shell: bash -l {0}
id: builddocs
env:
DOC_VERSION: ${{ steps.docversion.outputs.doc_version }}
# set -e makes sure bash fails on the first failing command, which isn't the case due to
# starting with -l
run: |
Expand Down
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'pydata_sphinx_theme'

# Use the version set in CI as necessary, which allows building "release" docs on a
# maintenance branch--strip leading 'v' since our json file doesn't have the v on the 'version'
doc_version = os.environ.get('DOC_VERSION', 'dev' if 'dev' in version else version).lstrip('v')
html_theme_options = {
'external_links': [
{'name': 'Release Notes', 'url': 'https://github.com/Unidata/MetPy/releases'},
Expand Down Expand Up @@ -240,7 +244,7 @@
'navbar_end': ['navbar-icon-links', 'theme-switcher'],
'switcher': {
'json_url': 'https://unidata.github.io/MetPy/pst-versions.json',
'version_match': 'dev' if 'dev' in version else f'v{version}',
'version_match': doc_version
},
'navigation_with_keys': False
}
Expand Down

0 comments on commit ccaf509

Please sign in to comment.