From 6c4dab4dfa7af14fae9d3eac132c2835542bce63 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 2 Mar 2026 16:47:27 +0000 Subject: [PATCH 1/2] Add Plausble analytics --- _templates/page.html | 7 +++++++ conf.py | 1 + 2 files changed, 8 insertions(+) create mode 100644 _templates/page.html diff --git a/_templates/page.html b/_templates/page.html new file mode 100644 index 000000000..ca1876fc6 --- /dev/null +++ b/_templates/page.html @@ -0,0 +1,7 @@ +{% extends "!page.html" %} + +{% block extrahead %} +{{ super() }} + + +{% endblock %} diff --git a/conf.py b/conf.py index c38e33dd8..569f44ed5 100644 --- a/conf.py +++ b/conf.py @@ -37,6 +37,7 @@ "source_repository": "https://github.com/python/devguide", "source_branch": "main", } +templates_path = ['_templates'] html_static_path = ['_static'] html_css_files = [ 'devguide_overrides.css', From 113946daf954d2e983680c2045c6a48207328a97 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 2 Mar 2026 19:03:06 +0000 Subject: [PATCH 2/2] Disable for RTD previews --- _templates/page.html | 3 ++- conf.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/_templates/page.html b/_templates/page.html index ca1876fc6..33ae2d56a 100644 --- a/_templates/page.html +++ b/_templates/page.html @@ -2,6 +2,7 @@ {% block extrahead %} {{ super() }} +{% if not READTHEDOCS %} - +{% endif %} {% endblock %} diff --git a/conf.py b/conf.py index 569f44ed5..7c0dae346 100644 --- a/conf.py +++ b/conf.py @@ -1,4 +1,5 @@ import json +import os from urllib.request import urlopen extensions = [ @@ -51,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