modified blog/layouts/_default/baseof.html +8 -0
| @@ -346,6 +346,14 @@ |
| 346 | 346 | </script> |
| 347 | 347 | <script data-goatcounter="https://mykiwi.goatcounter.com/count" |
| 348 | 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 | 357 | {{ block "head" . }}{{ end }} |
| 350 | 358 | </head> |
| 351 | 359 | {{- /* |
| @@ -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 | {{- /* |