Skip to content

Commit

Permalink
Make GoatCounter ignore the URL query (#1248)
Browse files Browse the repository at this point in the history
The snippet comes from the
[documentation](https://www.goatcounter.com/help/path#using-window-goatcounter-490).

We should probably be able to get the canonical path from mdbook, but I
couldn't find how to get the `site-url` into the template, which we
would want to avoid hardcoding `/agda-unimath` in too many places.

There's also the issue with `/`, `/index.html` and `/HOME.html` all
being the same page with different paths, but I didn't want to put too
much effort into coming up with a principled fix.

Fixes #1247
  • Loading branch information
VojtechStep authored Jan 30, 2025
1 parent f17e26a commit 6caff32
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@

</div>

<script>
window.goatcounter = {
path: location.pathname || '/'
};
</script>
<script data-goatcounter="https://agda-unimath.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
</body>

Expand Down

0 comments on commit 6caff32

Please sign in to comment.