Skip to content

Commit 113946d

Browse files
Disable for RTD previews
1 parent 6c4dab4 commit 113946d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

_templates/page.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
{% block extrahead %}
44
{{ super() }}
5+
{% if not READTHEDOCS %}
56
<script defer data-domain="devguide.python.org" src="https://analytics.python.org/js/script.outbound-links.js"></script>
6-
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
7+
{% endif %}
78
{% endblock %}

conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import os
23
from urllib.request import urlopen
34

45
extensions = [
@@ -51,6 +52,10 @@
5152
# Set to '' to prevent appending "documentation" to the site title
5253
html_title = ""
5354

55+
html_context = {
56+
"READTHEDOCS": bool(os.getenv("READTHEDOCS")),
57+
}
58+
5459
linkcheck_allowed_redirects = {
5560
# Edit page
5661
r"https://docs.google.com/document/d/.*/": r"https://docs.google.com/document/d/.*/edit", # noqa: E501

0 commit comments

Comments
 (0)