Skip to content

Commit 2df8071

Browse files
authored
1 parent 88f7828 commit 2df8071

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

doc/conf.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import re
1616
import sys
1717

18+
import sphinx_rtd_theme
19+
1820
HERE = os.path.abspath(os.path.dirname(__file__))
1921

2022

@@ -122,13 +124,15 @@ def find_version(*file_paths):
122124

123125
# The theme to use for HTML and HTML Help pages. See the documentation for
124126
# a list of builtin themes.
125-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
127+
if os.environ.get("READTHEDOCS", None) == "True":
128+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
126129

127-
if not on_rtd: # only import and set the theme if we're building docs locally
128-
import sphinx_rtd_theme
130+
if "html_context" not in globals():
131+
html_context = {}
132+
html_context["READTHEDOCS"] = True
129133

130-
html_theme = "sphinx_rtd_theme"
131-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
134+
html_theme = "sphinx_rtd_theme"
135+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
132136

133137
# Theme options are theme-specific and customize the look and feel of a theme
134138
# further. For a list of options available for each theme, see the

0 commit comments

Comments
 (0)