Skip to content

Commit 8807c59

Browse files
authored
DOCS Set html_baseurl (#128)
readthedocs used to set this automatically but they say they've deprecated that behavior.
1 parent fe27625 commit 8807c59

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

docs/conf.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import sys
23
from importlib import metadata as importlib_metadata
34
from pathlib import Path
@@ -25,19 +26,23 @@
2526
templates_path = ["_templates"]
2627
exclude_patterns = ["_build", "Thumbs.db", ".*"]
2728

28-
html_css_files = [
29-
"css/pyodide.css",
30-
]
3129

3230
# -- Options for HTML output -------------------------------------------------
3331
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
32+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
3433

35-
sys.path.append(Path(__file__).parent.parent.as_posix())
34+
html_css_files = [
35+
"css/pyodide.css",
36+
]
3637

3738
html_theme = "sphinx_book_theme"
3839
html_logo = "_static/img/pyodide-logo.png"
3940
html_static_path = ["_static"]
4041

42+
43+
sys.path.append(Path(__file__).parent.parent.as_posix())
44+
45+
4146
try:
4247
release = importlib_metadata.version("micropip")
4348
except importlib_metadata.PackageNotFoundError:

0 commit comments

Comments
 (0)