Skip to content

Commit

Permalink
Fix plausible logging on doc_libs_placeholder based pages (#1579) (#1582
Browse files Browse the repository at this point in the history
)
  • Loading branch information
daveoconnor authored Jan 7, 2025
1 parent 76b2455 commit 8224425
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,13 @@ def process_content(self, content):
)
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,
Expand Down
4 changes: 3 additions & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 8224425

Please sign in to comment.