mirror of
https://github.com/danbulant/Mangades
synced 2026-05-19 04:08:46 +00:00
update goatcounter
This commit is contained in:
parent
bc512c194f
commit
042f823670
3 changed files with 14 additions and 2 deletions
|
|
@ -17,7 +17,7 @@
|
|||
<script type="module" src="/build/main.js"></script>
|
||||
<script src="https://unpkg.com/web-streams-polyfill/dist/polyfill.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/streamsaver@2.0.5/StreamSaver.min.js"></script>
|
||||
<script data-goatcounter="https://manga.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
|
||||
<script data-goatcounter="https://manga.goatcounter.com/count" src="//gc.zgo.at/count.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
"build:static": "spank",
|
||||
"serve": "spassr --ssr",
|
||||
"rollup": "rollup -cw",
|
||||
"nollup": "nollup -c --verbose",
|
||||
"nollup": "nollup -c --verbose --host 0.0.0.0",
|
||||
"routify": "routify"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,17 @@
|
|||
<script>
|
||||
import { logs } from "../util/logs";
|
||||
import { afterPageLoad } from "@roxi/routify";
|
||||
|
||||
let skipFirst = true;
|
||||
$afterPageLoad(page => {
|
||||
if(skipFirst) return skipFirst = false;
|
||||
if(window.goatcounter) window.goatcounter.count({
|
||||
path: page.path,
|
||||
title: page.title,
|
||||
referrer: page.prev.path
|
||||
});
|
||||
else console.warn("Page change; GoatCounter not loaded (yet?)", page.path);
|
||||
})
|
||||
</script>
|
||||
|
||||
<!-- routify:options preload="proximity" -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue