init
Some checks failed
Deploy Jekyll site to Pages / build (push) Failing after 3m59s

This commit is contained in:
2025-02-27 22:54:37 +01:00
parent d560021845
commit 1e3657f788
176 changed files with 11248 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
<!-- Display GoatCounter pageviews -->
<script>
let pv = document.getElementById('pageviews');
if (pv !== null) {
const uri = location.pathname.replace(/\/$/, '');
const url = `https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/${encodeURIComponent(uri)}.json`;
fetch(url)
.then((response) => response.json())
.then((data) => {
const count = data.count.replace(/\s/g, '');
pv.innerText = new Intl.NumberFormat().format(count);
})
.catch((error) => {
pv.innerText = '1';
});
}
</script>