Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 87f639f

Browse filesBrowse files
committed
Use canonicals on ReadTheDocs
If environment variable READTHEDOCS_CANONICAL_URL is definied, set html_baseurl variable so Sphinx can grab it.
1 parent 03fb990 commit 87f639f
Copy full SHA for 87f639f

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

‎docs/conf.py

Copy file name to clipboardExpand all lines: docs/conf.py
+4
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ def find_version(*file_paths):
211211
html_static_path = ["_static"]
212212
html_css_files = ["css/custom.css"]
213213

214+
# Canonical link relation
215+
if os.environ.get("READTHEDOCS_CANONICAL_URL"):
216+
html_baseurl = f"{os.environ['READTHEDOCS_CANONICAL_URL']}"
217+
214218
# html_logo = "logo.svg"
215219

216220
# -- Options for HTMLHelp output ------------------------------------------

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.