Skip to content

feat: allow disabling of analytics through a Sphinx option#43

Merged
sburton84 merged 1 commit into
mainfrom
disablable-analytics
Jul 1, 2026
Merged

feat: allow disabling of analytics through a Sphinx option#43
sburton84 merged 1 commit into
mainfrom
disablable-analytics

Conversation

@sburton84

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Sphinx theme option to control whether Google Analytics is enabled, and threads that setting into the React nav injection so GA can be turned off for non-production builds.

Changes:

  • Introduces enable_analytics theme option (default false) in theme.toml.
  • Passes the option into the DOM via data-analytics-enabled on the .nexus-nav mount element.
  • Conditions Google Analytics rendering on both cookie consent and the new data-analytics-enabled flag.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
sphinx-ui/react/src/injectNav.tsx Reads data-analytics-enabled and uses it to gate GA rendering.
sphinx-ui/quantinuum_sphinx/theme.toml Adds enable_analytics option with default false and inline guidance.
sphinx-ui/quantinuum_sphinx/page.html Emits data-analytics-enabled from theme_enable_analytics into the mount element.
sphinx-ui/demo/source/conf.py Documents how to enable analytics via html_theme_options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sphinx-ui/react/src/injectNav.tsx
@sburton84 sburton84 marked this pull request as ready for review July 1, 2026 15:47
@sburton84 sburton84 merged commit a631c83 into main Jul 1, 2026
5 checks passed
@sburton84 sburton84 deleted the disablable-analytics branch July 1, 2026 15:47
@sburton84 sburton84 restored the disablable-analytics branch July 1, 2026 17:00
@sburton84 sburton84 deleted the disablable-analytics branch July 1, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants