From 8ba18f23608833210e981e343898a88163981554 Mon Sep 17 00:00:00 2001 From: Emma Segal-Grossman Date: Tue, 19 Nov 2024 12:55:10 -0500 Subject: [PATCH] [Docs]: Only enable Plausible on deployment builds (#2162) Tested locally. --- .github/workflows/docs-publish.yaml | 7 +++++-- .../partials/integrations/analytics/plausible.html | 4 ++++ frontend/docs/mkdocs.yml | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 frontend/docs/docs/overrides/partials/integrations/analytics/plausible.html diff --git a/.github/workflows/docs-publish.yaml b/.github/workflows/docs-publish.yaml index d90569ee..dc73967f 100644 --- a/.github/workflows/docs-publish.yaml +++ b/.github/workflows/docs-publish.yaml @@ -1,7 +1,7 @@ name: Publish Docs on: workflow_dispatch: - + release: types: [published] @@ -21,4 +21,7 @@ jobs: - name: Generate Helm Chart Index run: python ./scripts/generate-helm-index.py > ./frontend/docs/docs/helm-repo/index.yaml - - run: cd frontend/docs; mkdocs gh-deploy --force + - name: Build Docs + run: cd frontend/docs; mkdocs gh-deploy --force + env: + ENABLE_ANALYTICS: true diff --git a/frontend/docs/docs/overrides/partials/integrations/analytics/plausible.html b/frontend/docs/docs/overrides/partials/integrations/analytics/plausible.html new file mode 100644 index 00000000..82ec960a --- /dev/null +++ b/frontend/docs/docs/overrides/partials/integrations/analytics/plausible.html @@ -0,0 +1,4 @@ +{% if config.extra.enable_analytics %} + + +{% endif %} diff --git a/frontend/docs/mkdocs.yml b/frontend/docs/mkdocs.yml index 71a326e7..7eb9381d 100644 --- a/frontend/docs/mkdocs.yml +++ b/frontend/docs/mkdocs.yml @@ -124,6 +124,9 @@ extra: link: https://digipres.club/@webrecorder - icon: bootstrap/youtube link: https://www.youtube.com/@webrecorder + analytics: + provider: plausible + enable_analytics: !ENV ENABLE_ANALYTICS copyright: "Creative Commons Attribution 4.0 International (CC BY 4.0)" plugins: