From b1951991186580617b37a4e08f3bceced996b543 Mon Sep 17 00:00:00 2001 From: takuro saito Date: Mon, 19 May 2025 14:07:21 +0900 Subject: [PATCH] set ga4 --- .github/workflows/docs.yml | 7 +++++++ docs/en/_config.yml | 2 ++ docs/ja/_config.yml | 2 ++ 3 files changed, 11 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 67892e8..d04fe50 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -30,7 +30,14 @@ jobs: uv sync --all-extras --dev - name: Build the book + env: + GA4_TRACKING_ID: ${{ secrets.GA4_TRACKING_ID }} run: | + # Replace GA4_TRACKING_ID placeholder with actual value from secrets + # Using | as delimiter to avoid issues with / in the GA4 ID + sed -i "s|GA4_TRACKING_ID|${GA4_TRACKING_ID}|g" docs/${{ matrix.lang }}/_config.yml + + # Build the book uv run jupyter-book build docs/${{ matrix.lang }} ERROR_LOGS=$(find docs/${{ matrix.lang }}/_build -type f -name "*.err.log") if [ -n "$ERROR_LOGS" ]; then while IFS= read -r log; do echo "[ERROR LOG] $log" && cat "$log"; done <<< "$ERROR_LOGS" && exit 1; fi diff --git a/docs/en/_config.yml b/docs/en/_config.yml index d387bbc..6e292c5 100644 --- a/docs/en/_config.yml +++ b/docs/en/_config.yml @@ -32,6 +32,8 @@ html: favicon: "./logo.png" use_issues_button: true use_repository_button: true + analytics: + google_analytics_id: GA4_TRACKING_ID launch_buttons: notebook_interface: "classic" diff --git a/docs/ja/_config.yml b/docs/ja/_config.yml index a1e89a9..4dfe36f 100644 --- a/docs/ja/_config.yml +++ b/docs/ja/_config.yml @@ -32,6 +32,8 @@ html: favicon: "./logo.png" use_issues_button: true use_repository_button: true + analytics: + google_analytics_id: GA4_TRACKING_ID launch_buttons: notebook_interface: "classic"