Visits are counted by GoatCounter, the blog's own, as host and path: a table's code never reaches the count, and a page reached without a reload is counted too
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CCLa2PaEeCj8njQZSWGqHx
This commit is contained in:
1 parent
9de0a55d54
commit
b8f65a74d3
2 files changed
+11
No files matched your search
@@ -30,6 +30,11 @@
|
|||||||
href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..700&display=swap"
|
href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..700&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
|
<!-- Visits are counted by GoatCounter, as host and path, with no table's code in the path. -->
|
||||||
|
<script>
|
||||||
|
window.goatcounter = { path: () => location.host + location.pathname.replace(/^\/join\/[^/]+/, '/join') };
|
||||||
|
</script>
|
||||||
|
<script data-goatcounter="https://kestrelsnest.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover">
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import '../app.css';
|
import '../app.css';
|
||||||
|
import { afterNavigate } from '$app/navigation';
|
||||||
import Announcement from '$lib/components/Announcement.svelte';
|
import Announcement from '$lib/components/Announcement.svelte';
|
||||||
|
|
||||||
let { children } = $props();
|
let { children } = $props();
|
||||||
|
|
||||||
|
// A page reached without a reload is counted as a visit too; the first load counts itself.
|
||||||
|
afterNavigate(({ type }) => {
|
||||||
|
if (type !== 'enter') (window as { goatcounter?: { count?: () => void } }).goatcounter?.count?.();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Announcement />
|
<Announcement />
|
||||||
|
|||||||
Reference in new issue
Block a user