Merge pull request #166 from cambid/umami

Support for Umami analytics
This commit is contained in:
Dmitry Kolosov 2023-04-28 13:12:56 +02:00 committed by GitHub
commit 901df3239e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -16,6 +16,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
- Mobile support - Mobile support
- Social icons - Social icons
- Google Analytics - Google Analytics
- Umami Analytics
- Comment systems: Disqus, ISSO, Utteranc.es, GraphComment - Comment systems: Disqus, ISSO, Utteranc.es, GraphComment
- RSS feeds - RSS feeds
- Related posts (Read Next section) - Related posts (Read Next section)
@ -120,6 +121,12 @@ params:
avatar: true # optional avatar: true # optional
avatar-bg: "#f0f0f0" # optional avatar-bg: "#f0f0f0" # optional
feed: false # optional feed: false # optional
UmamiAnalytics:
enabled: true # mandatory
dnt: true # optional
id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # mandatory
datacache: false # optional
url: "https://abc.example.com/umami.js" # mandatory
graphcommentId: "" graphcommentId: ""
webmentions: webmentions:
url: https://yourdomain.com/webemntions/receive url: https://yourdomain.com/webemntions/receive

View File

@ -72,4 +72,8 @@
{{ template "_internal/google_analytics.html" . }} {{ template "_internal/google_analytics.html" . }}
{{ end }} {{ end }}
{{ if (.Site.Params.UmamiAnalytics.enabled ) }}
{{ partial "umami_analytics.html" . }}
{{ end }}
{{ partial "head-extra.html" . }} {{ partial "head-extra.html" . }}

View File

@ -0,0 +1,3 @@
{{ $dnt := .Site.Params.UmamiAnalytics.dnt | default "false" }}
{{ $datacache := .Site.Params.UmamiAnalytics.datacache | default "false" }}
<script async defer data-website-id="{{ .Site.Params.UmamiAnalytics.id }}" data-cache="{{ $datacache }}" data-do-not-track="{{ $dnt }}" src="{{ .Site.Params.UmamiAnalytics.url }}"></script>