Skip to content

docs: Add CSS and JS files for page cookie banner (Infra) - #2735

Merged
pieqq merged 1 commit into
mainfrom
docs-fix-cookie-banner
Jul 29, 2026
Merged

docs: Add CSS and JS files for page cookie banner (Infra)#2735
pieqq merged 1 commit into
mainfrom
docs-fix-cookie-banner

Conversation

@tang-mm

@tang-mm tang-mm commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

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.

  • Added external URL from Ubuntu Assets to the html_css_files and html_js_files list in docs/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/

image image

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

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_files for the cookie banner styling.
  • Added a remote JavaScript asset URL to html_js_files for 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.

Comment thread docs/conf.py
@tang-mm
tang-mm force-pushed the docs-fix-cookie-banner branch from ede33d8 to fa0d134 Compare July 29, 2026 09:50
@pieqq
pieqq merged commit f70117a into main Jul 29, 2026
11 checks passed
@pieqq
pieqq deleted the docs-fix-cookie-banner branch July 29, 2026 10:55
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.

3 participants