[Docs]: Only enable Plausible on deployment builds (#2162)

Tested locally.
This commit is contained in:
Emma Segal-Grossman 2024-11-19 12:55:10 -05:00 committed by GitHub
parent 0cbc279773
commit 8ba18f2360
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -0,0 +1,4 @@
{% if config.extra.enable_analytics %}
<script defer data-domain="docs.browsertrix.com" src="https://p.webrecorder.net/js/script.outbound-links.js"></script>
<script>window.plausible = window.plausible || function () { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
{% endif %}

View File

@ -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: