From 18da2770c6e805777cf0208138d4977817e92507 Mon Sep 17 00:00:00 2001 From: Veit Schiele Date: Wed, 17 Jul 2024 10:17:58 +0200 Subject: [PATCH] :wrench: Set canonical URL from the Read the Docs Domain --- docs/conf.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 53d67f9e..d5e703af 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,8 +14,6 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os -# import sys # sys.path.insert(0, os.path.abspath('.')) @@ -24,6 +22,14 @@ import os import re +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +html_context = {} +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + html_context["READTHEDOCS"] = True + project = "Python for Data Science" author = "Veit Schiele" copyright = f"2019–2024, {author}"