From 0b2eda997372f29481d7a213c860b1713f30e189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Be=C3=B1at=20Espi=C3=B1a?= Date: Sat, 17 Oct 2026 16:09:38 +0200 Subject: [PATCH 1/2] docs: count visits with Cloudflare Web Analytics Under the bounda.dev site, which also counts the landing and the demo, so the launch can be read in one place. No cookies. --- docs/astro.config.mjs | 4 ++-- docs/src/site.ts | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index ba4b84d5..aa97b230 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -5,7 +5,7 @@ import starlightPageActions from "starlight-page-actions"; import { codeHeader } from "./src/code-header.ts"; import { basalt, bone } from "./src/code-themes.ts"; import { SIDEBAR } from "./src/sidebar.ts"; -import { DESCRIPTION, PROMPT, SITE, socialImage } from "./src/site.ts"; +import { analytics, DESCRIPTION, PROMPT, SITE, socialImage } from "./src/site.ts"; // The fonts of bounda.dev, self-hosted at build time with metric-matched fallbacks. Science Gothic // is only ever set at 600, so it is requested at that one weight across the width axis it uses. @@ -55,7 +55,7 @@ export default defineConfig({ }, description: DESCRIPTION, customCss: ["./src/styles/bounda.css"], - head: socialImage(`${SITE}/og.jpg`), + head: [...socialImage(`${SITE}/og.jpg`), analytics], routeMiddleware: "./src/route-data.ts", // src/pages/404.astro keeps the sidebar and offers the search. disable404Route: true, diff --git a/docs/src/site.ts b/docs/src/site.ts index e878f716..0568d2e6 100644 --- a/docs/src/site.ts +++ b/docs/src/site.ts @@ -2,6 +2,16 @@ export const SITE = "https://docs.bounda.dev"; export const REPOSITORY = "https://github.com/bounda-dev/bounda"; +// Cloudflare Web Analytics, without cookies; the site is bounda.dev's, which counts this subdomain too. +export const analytics: HeadTag = { + tag: "script", + attrs: { + type: "module", + src: "https://static.cloudflareinsights.com/beacon.min.js", + "data-cf-beacon": '{"token": "26093f976db946eeba633b04b7def982"}', + }, +}; + export const DESCRIPTION = "Event sourcing and CQRS for TypeScript without the ceremony."; // What a page hands to a chat; `{url}` becomes the page's address. @@ -15,8 +25,8 @@ const socialImageAlt = "The Bounda symbol as a machined monolith whose foot becomes the global stream, beside the headline: Event sourcing without the ceremony."; export interface HeadTag { - readonly tag: "meta"; - readonly attrs: { readonly property?: string; readonly name?: string; readonly content: string }; + readonly tag: "meta" | "script"; + readonly attrs: Readonly>; } export interface SocialImageFunction { From dcb019cd47a89dd42d397154f1a1973921b1e343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Be=C3=B1at=20Espi=C3=B1a?= Date: Sat, 17 Oct 2026 16:11:33 +0200 Subject: [PATCH 2/2] docs: let a head tag's attributes be absent, as the social image's are The social image's meta tags each set name or property, so their union carries the other as undefined, which a Record of strings refused. --- docs/src/site.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/site.ts b/docs/src/site.ts index 0568d2e6..177cd2e7 100644 --- a/docs/src/site.ts +++ b/docs/src/site.ts @@ -26,7 +26,7 @@ const socialImageAlt = export interface HeadTag { readonly tag: "meta" | "script"; - readonly attrs: Readonly>; + readonly attrs: Readonly>; } export interface SocialImageFunction {