docs: Add CSS and JS files for page cookie banner (Infra) - #2735
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Sphinx documentation configuration in docs/ to include Canonical-hosted cookie banner assets (CSS + JS) so the docs site can display the Google Analytics consent banner when hosted on ubuntu.com/docs/checkbox.
Changes:
- Added a remote CSS asset URL to
html_css_filesfor the cookie banner styling. - Added a remote JavaScript asset URL to
html_js_filesfor the cookie banner behavior.
Comments suppressed due to low confidence (1)
docs/conf.py:197
- The comment says JavaScript files are located under 'html_static_path', but this list now includes a remote URL; this is misleading. Also, the inline comment spacing is inconsistent (PEP 8 recommends two spaces before an inline # comment).
# Adds custom JavaScript files, located under 'html_static_path'
html_js_files = [
"overwrite_links.js", # support ReadTheDocs flyout when hosted at ubuntu.com/docs
"https://assets.ubuntu.com/v1/287a5e8f-bundle.js", # Google Analytics cookie banner
]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tang-mm
force-pushed
the
docs-fix-cookie-banner
branch
from
July 29, 2026 09:50
ede33d8 to
fa0d134
Compare
pieqq
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the documentation configuration to support for Google Analytics cookie banner, by adding remote CSS and JavaScript files.
Description
This pull request updates the documentation configuration to support for Google Analytics cookie banner, by adding remote CSS and JavaScript files.
html_css_filesandhtml_js_fileslist indocs/conf.py.Resolved issues
Follow-up of CDOC-370 and #2718
Documentation
NA
Tests
On the build preview page, a cookie banner should pop up upon a new session or when clicking the "Manage your tracker settings" link in the page footer.
Preview: https://canonical-checkbox--2735.com.readthedocs.build/2735/