Skip to content

Commit

Permalink
Install Plausible analytics to the website
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Mar 11, 2024
1 parent 2777e5f commit b9913c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions docs/_includes/head.njk
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ dd { margin-bottom: var(--typography-spacing-vertical); }
margin-top: 1rem;
}
</style>
{% if plausible_domain %}
<script
defer
data-domain="{{ plausible_domain }}"
src="https://plausible.io/js/script.js"></script>
{% endif %}

0 comments on commit b9913c7

Please sign in to comment.