add plausible analytics

pull/584/head
Dejavu Moe 2023-06-16 10:22:49 +08:00
parent 84f0861e8f
commit d4d6698168
No known key found for this signature in database
GPG Key ID: 8422222222222222
2 changed files with 16 additions and 1 deletions

View File

@ -70,6 +70,12 @@ fingerprintAlgorithm = "sha256"
# site = "ABC12345"
# domain = "llama.yoursite.com"
[plausible]
enable = false
domain = "llama.yoursite.com"
event = ""
script = ""
[verification]
# google = ""
# bing = ""

View File

@ -6,5 +6,14 @@
<script defer src="https://cdn.usefathom.com/script.js" data-site="{{ . }}"></script>
{{ end }}
{{ end }}
{{ if site.Params.plausible.enable }}
{{ with site.Params.plausible.domain }}
<script
defer
data-domain="{{ . }}"
data-api="{{ default "https://plausible.io/api/event" site.Params.plausible.event }}"
src="{{ default "https://plausible.io/js/script.js" site.Params.plausible.script }}"></script>
{{ end }}
{{ end }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
{{ end }}