From b9913c70113f6d6c3a440a4c1dfce2175d06b054 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 11 Mar 2024 22:37:36 +0900 Subject: [PATCH] Install Plausible analytics to the website --- .github/workflows/build.yaml | 10 ++++++++++ docs/_includes/head.njk | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d9ea7bfa..d9097e19 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -138,6 +138,16 @@ jobs: - uses: denoland/setup-deno@v1 with: deno-version: v1.x + - run: | + set -ex + jq \ + --arg domain "$PLAUSIBLE_DOMAIN" \ + '.plausible_domain = $domain' \ + _data.json > _data.json.tmp + mv _data.json.tmp _data.json + env: + PLAUSIBLE_DOMAIN: ${{ secrets.PLAUSIBLE_DOMAIN }} + working-directory: ${{ github.workspace }}/docs/ - run: deno task lume working-directory: ${{ github.workspace }}/docs/ - uses: actions/upload-pages-artifact@v3 diff --git a/docs/_includes/head.njk b/docs/_includes/head.njk index 5749c18a..65049325 100644 --- a/docs/_includes/head.njk +++ b/docs/_includes/head.njk @@ -42,3 +42,9 @@ dd { margin-bottom: var(--typography-spacing-vertical); } margin-top: 1rem; } +{% if plausible_domain %} + +{% endif %}