the home site for me: also iteration 3 or 4 of my site

feat: track page hits per page

Changed files
+2 -2
templates
+1 -1
templates/footer.html
···
<div id="footer-container">
<p style="margin-bottom: 0.5rem">
&copy; {{ now() | date(format="%Y") }} Kieran Klukas ||
-
<code id="visits">0</code> visits since 2025.02.18 || {% set hash =
+
<code id="visits">0</code> page visits || {% set hash =
get_env(name="CF_PAGES_COMMIT_SHA", default=load_data(path=".git/refs/heads/main", required=false))%}{% if hash is not string %}{% set hash = "unknown" %}{% endif %}<a href=https://github.com/taciturnaxolotl/zera/tree/{{ hash }}>zera@{{ hash |
truncate(length=7, end="")}}</a>
</p>
+1 -1
templates/head.html
···
});
}
</script>
-
<script async src="https://abacus.jasoncameron.dev/hit/dunkirk.sh/counter?callback=cb"></script>
+
<script async src="https://abacus.jasoncameron.dev/hit/dunkirk.sh/counter{%- if url | split(pat='/') | slice(start=3) | join != '' -%}-{{url | split(pat='/') | slice(start=3) | join(sep=' ') | slugify}}{%- endif -%}?callback=cb"></script>