From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 7 Jun 2024 07:42:37 +0000 (+0200) Subject: [3.12] Add Plausible for docs metrics (GH-119977) (#120194) X-Git-Tag: v3.12.5~257 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92a38e98740b244b0b0e79c8d03ea29422a66d0c;p=thirdparty%2FPython%2Fcpython.git [3.12] Add Plausible for docs metrics (GH-119977) (#120194) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Julien Palard --- diff --git a/Doc/conf.py b/Doc/conf.py index e292bdd5003b..e38476a0b705 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -323,7 +323,8 @@ repository_url = os.getenv("READTHEDOCS_GIT_CLONE_URL") html_context = { "is_deployment_preview": os.getenv("READTHEDOCS_VERSION_TYPE") == "external", "repository_url": repository_url.removesuffix(".git") if repository_url else None, - "pr_id": os.getenv("READTHEDOCS_VERSION") + "pr_id": os.getenv("READTHEDOCS_VERSION"), + "enable_analytics": os.getenv("PYTHON_DOCS_ENABLE_ANALYTICS"), } # This 'Last updated on:' timestamp is inserted at the bottom of every page. diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index e931147813ae..394ebee5f9e1 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -26,6 +26,9 @@ {% endblock %} {% block extrahead %} + {% if builder == "html" and enable_analytics %} + + {% endif %} {% if builder != "htmlhelp" %} {% if pagename == 'whatsnew/changelog' and not embedded %}