mykiwi/mykiwi.blogpublic Fork
⑂ bda94bb
Commits
⬇ Clone ▾
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

Count boosted navigations in GoatCounter too

Romain Gautier committed 2026-09-24T00:08:18+02:00 Browse files
bda94bb parent: cd36233
modified blog/layouts/_default/baseof.html +8 -0
@@ -346,6 +346,14 @@
346346 </script>
347347 <script data-goatcounter="https://mykiwi.goatcounter.com/count"
348348 async src="//gc.zgo.at/count.js"></script>
349+ {{- /* count.js only sees the first full load; hx-boost navigations after
350+ that never reload <head>, so each one is reported by hand. The initial
351+ load fires no swap event, so nothing is counted twice. */}}
352+ <script>
353+ document.addEventListener("htmx:after:swap", () => {
354+ window.goatcounter?.count?.({path: location.pathname + location.search, title: document.title});
355+ });
356+ </script>
349357 {{ block "head" . }}{{ end }}
350358 </head>
351359 {{- /*
@@ -346,6 +346,14 @@
346 </script>346 </script>
347 <script data-goatcounter="https://mykiwi.goatcounter.com/count"347 <script data-goatcounter="https://mykiwi.goatcounter.com/count"
348 async src="//gc.zgo.at/count.js"></script>348 async src="//gc.zgo.at/count.js"></script>
349+ {{- /* count.js only sees the first full load; hx-boost navigations after
350+ that never reload <head>, so each one is reported by hand. The initial
351+ load fires no swap event, so nothing is counted twice. */}}
352+ <script>
353+ document.addEventListener("htmx:after:swap", () => {
354+ window.goatcounter?.count?.({path: location.pathname + location.search, title: document.title});
355+ });
356+ </script>
349 {{ block "head" . }}{{ end }}357 {{ block "head" . }}{{ end }}
350 </head>358 </head>
351 {{- /*359 {{- /*