From 0806f21cbc462180f8f2ef3e916443ca16ae0371 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 20 Aug 2026 15:46:39 +0000 Subject: [PATCH 1/2] docs: add the Cloudflare Web Analytics beacon to the published site The GitHub Pages site is the Sphinx HTML tree the Pages workflow builds and uploads from Documentation/, so there is no hand-written page to paste Cloudflare's snippet into. Override the theme's `footer` block -- the last block before `` in the basic theme alabaster derives from -- so the beacon lands where Cloudflare's snippet expects it on every generated page, with `super()` preserving the theme's own footer and GitHub banner. docs/_templates was already on templates_path (and is what sphinx-celery defaults to), so no conf.py change is needed for Sphinx to pick this up. Changing a template also bumps the newest-template mtime, which makes Sphinx rewrite every page rather than only the ones whose sources changed, so an incremental build still picks up the beacon everywhere. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01JEBC19ggdKCkK5sUt7UUSG --- docs/_templates/layout.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docs/_templates/layout.html diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html new file mode 100644 index 000000000..d038392cf --- /dev/null +++ b/docs/_templates/layout.html @@ -0,0 +1,15 @@ +{%- extends "!layout.html" %} + +{# Cloudflare Web Analytics. + + The published site (https://faust-streaming.github.io/faust) is the Sphinx + HTML tree the Pages workflow builds, so there is no hand-written page to + paste Cloudflare's snippet into -- a template override is what puts it on + every generated page instead. `footer` is the last block before `` + in the basic theme alabaster derives from, which is where the snippet + belongs; `super()` keeps the theme's own footer and GitHub banner. +#} +{%- block footer %} + {{ super() }} + +{%- endblock %} From d2f650a86c74b8dab72e5c8f279ea4bf6bd5a040 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 20 Aug 2026 15:56:20 +0000 Subject: [PATCH 2/2] docs: load the Cloudflare beacon as a classic deferred script Use Cloudflare's documented `defer` form instead of `type='module'`. A module script is deferred anyway, so the loading behaviour is unchanged, but `document.currentScript` is null while a module executes and that is how a beacon reads the `data-cf-beacon` token off its own tag. The classic form keeps the token readable however the beacon looks it up, and additionally runs in browsers that skip module scripts. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01JEBC19ggdKCkK5sUt7UUSG --- docs/_templates/layout.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index d038392cf..037a78558 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -8,8 +8,15 @@ every generated page instead. `footer` is the last block before `` in the basic theme alabaster derives from, which is where the snippet belongs; `super()` keeps the theme's own footer and GitHub banner. + + This is Cloudflare's documented classic `defer` form rather than a + `type='module'` one. A module script is deferred anyway, so nothing is + lost -- but `document.currentScript` is null while a module executes, and + that is how a beacon reads the `data-cf-beacon` token off its own tag. The + classic form keeps the token readable however the beacon looks it up, and + still runs in browsers that skip module scripts. #} {%- block footer %} {{ super() }} - + {%- endblock %}