From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 7 Jun 2024 06:38:31 +0000 (-0600) Subject: Add Plausible for docs metrics (#119977) X-Git-Tag: v3.14.0a1~1575 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c115567b1e3aecb7a53cfd5757e25c088398411;p=thirdparty%2FPython%2Fcpython.git Add Plausible for docs metrics (#119977) Co-authored-by: Julien Palard --- diff --git a/Doc/conf.py b/Doc/conf.py index 47fb96fe1de4..8a14646801eb 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -339,7 +339,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 3f88fc8e91fa..b09fd21a8ddc 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 %}