Add self-hosted goat counter (#826)

* Add self-hosted goat counter

* GoatCounter custom instance and beckward compatibility

---------

Co-authored-by: SilverLuke <luca99.argentieri@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Luca Argentieri 2023-10-31 08:15:28 +01:00 committed by GitHub
parent e61d6b796b
commit 05c9d3d850
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
<!-- Add Analytics if enabled in configuration -->
{{ with site.Params.features.analytics }}
{{ if .enabled }}
{{ if or .enable .enabled }}
{{ with .services }}
<!-- Google Analytics -->
{{ with .google }}
@ -18,12 +18,12 @@
{{ end }}
<!-- GoatCounter -->
{{ with .goatCounter }}
<script
data-goatcounter="https://{{ .code }}.goatcounter.com/count"
async
src="//gc.zgo.at/count.js"
></script>
{{ with .goatCounter }}
{{ with .code }}
<script data-goatcounter="https://{{ . }}.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
{{ else }}
<script data-goatcounter="https://{{ .instance }}/count" async src="https://{{ .instance }}/count.js"></script>
{{ end }}
{{ end }}
<!-- Piwik/Matomo -->