From c3f17bb18e5f13dad4466227a8bb0dc55a7c7e73 Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Sun, 21 Jul 2024 21:12:30 +0200 Subject: [PATCH] Start Adapting to RTD Addons (#4386) --- docs/source/conf.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 5858a79e2..fdc3b27e8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,3 +1,4 @@ +import os import re import sys from pathlib import Path @@ -251,7 +252,14 @@ htmlhelp_basename = "python-telegram-bot-doc" # The base URL which points to the root of the HTML documentation. It is used to indicate the # location of document using The Canonical Link Relation. Default: ''. -html_baseurl = "https://docs.python-telegram-bot.org" +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +# Tell Jinja2 templates the build is running on Read the Docs +html_context = {} +if os.environ.get("READTHEDOCS", "") == "True": + html_context["READTHEDOCS"] = True + # -- Options for LaTeX output ---------------------------------------------