added support for plausible analytics

This commit is contained in:
Gabriele Musco 2020-10-16 20:02:18 +02:00
parent 87b54d99c1
commit 25cf285710
No known key found for this signature in database
GPG Key ID: 8539FD3454380B83
3 changed files with 15 additions and 0 deletions

View File

@ -30,6 +30,10 @@ paginate = 5 # number of articles per page in the index
# enable comments support with commento using the script from your server
commento = "https://example.com/js/commento.js"
# enable analytics using Plausible
plausibleScriptUrl = "https://something.com/..."
plausibleDomain = "gabmus.org"
# the links array shows links with icons (if explicitly supported)
# it's an array of arrays containing two strings: name and link
# the supported icons are:

View File

@ -9,5 +9,6 @@
</main>
{{- partial "footer.html" . -}}
</div>
{{- partial "plausible.html" . -}}
</body>
</html>

View File

@ -0,0 +1,10 @@
{{ if .Site.Params.plausibleScriptUrl }}
{{ if .Site.Params.plausibleDomain }}
<script
async
defer
data-domain="{{ .Site.Params.plausibleDomain }}"
src="{{ .Site.Params.plausibleScriptUrl }}"
></script>
{{ end }}
{{ end }}