Fix plausible logging on doc_libs_placeholder based pages (#1579) (#1582)

This commit is contained in:
daveoconnor
2025-01-07 12:03:43 -08:00
committed by GitHub
parent 76b2455fa1
commit 8224425acc
2 changed files with 9 additions and 3 deletions

View File

@@ -477,9 +477,13 @@ class DocLibsTemplateView(BaseStaticContentTemplateView):
)
context["content"] = soup.prettify()
else:
# potentially pass version if needed for HTML modification
# Potentially pass version if needed for HTML modification.
# We disable plausible to prevent redundant 'about:srcdoc' tracking,
# tracking is covered by docsiframe.html
base_html = render_to_string(
"docs_libs_placeholder.html", context, request=self.request
"docs_libs_placeholder.html",
{**context, **{"disable_plausible": True}},
request=self.request,
)
context["content"] = modernize_legacy_page(
content,

View File

@@ -5,9 +5,11 @@
<html lang="{{ LANGUAGE_CODE }}">
<head>
<script defer
{% if not disable_plausible %}
<script defer
data-domain="preview.boost.org"
src="https://plausible.io/js/script.manual.js"></script>
{% endif %}
<title>{% block title %}Boost{% endblock %}</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">