Skip to content

Commit

Permalink
Use ReadTheDocs variable for version match
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Feb 23, 2022
1 parent a1ae0a6 commit 9befb6c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

import pydata_sphinx_theme

release = pydata_sphinx_theme.__version__
version = release.replace("dev0", "")

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

Expand Down Expand Up @@ -80,10 +78,17 @@
html_theme = "pydata_sphinx_theme"
# html_logo = "_static/pandas.svg" # For testing

if "dev" in release:
version_match = "dev"
# Define the version we use for matching in the version switcher.
if os.environ.get("READTHEDOCS_VERSION"):
# If we detect a READTHEDOCS version, just use this.
version_match = os.environ.get("READTHEDOCS_VERSION")
else:
version_match = "v" + release
# For local development, infer the version to match from the package.
release = pydata_sphinx_theme.__version__
if "dev" in release:
version_match = "latest"
else:
version_match = "v" + release

html_theme_options = {
"external_links": [
Expand Down

0 comments on commit 9befb6c

Please sign in to comment.