diff --git a/_templates/page.html b/_templates/page.html new file mode 100644 index 000000000..33ae2d56a --- /dev/null +++ b/_templates/page.html @@ -0,0 +1,8 @@ +{% extends "!page.html" %} + +{% block extrahead %} +{{ super() }} +{% if not READTHEDOCS %} + +{% endif %} +{% endblock %} diff --git a/conf.py b/conf.py index c38e33dd8..7c0dae346 100644 --- a/conf.py +++ b/conf.py @@ -1,4 +1,5 @@ import json +import os from urllib.request import urlopen extensions = [ @@ -37,6 +38,7 @@ "source_repository": "https://github.com/python/devguide", "source_branch": "main", } +templates_path = ['_templates'] html_static_path = ['_static'] html_css_files = [ 'devguide_overrides.css', @@ -50,6 +52,10 @@ # Set to '' to prevent appending "documentation" to the site title html_title = "" +html_context = { + "READTHEDOCS": bool(os.getenv("READTHEDOCS")), +} + linkcheck_allowed_redirects = { # Edit page r"https://docs.google.com/document/d/.*/": r"https://docs.google.com/document/d/.*/edit", # noqa: E501