Skip to content

Commit 688a1ec

Browse files
committed
🔧 Set canonical URL from the Read the Docs Domain
1 parent 5f03dfb commit 688a1ec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/conf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55
# -- Project information -----------------------------------------------------
66
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
7+
import os
8+
9+
# Set canonical URL from the Read the Docs Domain
10+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
11+
12+
html_context = {}
13+
# Tell Jinja2 templates the build is running on Read the Docs
14+
if os.environ.get("READTHEDOCS", "") == "True":
15+
html_context["READTHEDOCS"] = True
716

817
project = "python.berlin"
918
copyright = "2023, Berlin Python User Groups"

0 commit comments

Comments
 (0)