From ebe03b8881a3471e579c1afcfc9f02b6e592c414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kozak?= Date: Wed, 19 Aug 2026 09:47:14 +0200 Subject: [PATCH] Track scaladoc site with Umami analytics scaladoc has no native flag for injecting a custom script into every generated page's (checked -help: -default-template only covers missing/empty static-site indexes). Every generated HTML file does have an identical, single-line though, so this injects the tracker there via sed right after generation, before the Pages upload. Verified locally against real scala-cli --power doc output. The same website-id is used across all 4 repos' scaladoc subdomains; Umami records hostname per pageview, so they can still be told apart in the dashboard/API without needing separate website ids. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/docs.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 8100170..4c64a8e 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -41,6 +41,10 @@ jobs: -snippet-compiler:compile \ -source-links:"src=github://halotukozak/mcodec?tag=${{ github.ref_name }}" \ -revision:${{ github.ref_name }} + - name: Inject Umami analytics + run: | + find scala-doc -name '*.html' -exec sed -i \ + 's###' {} + - name: Setup Pages uses: actions/configure-pages@v6 - name: Upload artifact