Skip to content

Commit 15660e8

Browse files
committed
🔧 Set canonical URL from the Read the Docs Domain
1 parent 015a9f4 commit 15660e8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/conf.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,18 @@
1414
# add these directories to sys.path here. If the directory is relative to the
1515
# documentation root, use os.path.abspath to make it absolute, like shown here.
1616
#
17-
# import os
18-
# import sys
1917
# sys.path.insert(0, os.path.abspath('.'))
18+
import os
19+
import re
20+
21+
22+
# Set canonical URL from the Read the Docs Domain
23+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
24+
25+
html_context = {}
26+
# Tell Jinja2 templates the build is running on Read the Docs
27+
if os.environ.get("READTHEDOCS", "") == "True":
28+
html_context["READTHEDOCS"] = True
2029

2130

2231
# -- Project information -----------------------------------------------------

0 commit comments

Comments
 (0)