Merge branch 'add-umami-support' into 'master'

Add umami analytics support

See merge request gabmus/hugo-ficurinia!1
This commit is contained in:
GabMus 2022-04-06 14:45:48 +00:00
commit a570911957
3 changed files with 15 additions and 0 deletions

View File

@ -107,6 +107,10 @@ summaryLength = 70 # number of words for article summaries
plausibleScriptUrl = "https://something.com/..."
plausibleDomain = "example.com"
# enable analytics using Umami
umamiScriptUrl = "https://something.com/..."
umamiWebsiteId = "example-tracking-code"
enableShareOnFediverse = false # enable a button at the end of an article to share it on the fediverse
tocBeforeImage = false # show the table of contents before the main article image; default false

View File

@ -14,6 +14,7 @@
</div>
</div>
{{- partial "plausible.html" . -}}
{{- partial "umami.html" . -}}
{{- partial "inject/body.html" . -}}
</body>
</html>

View File

@ -0,0 +1,10 @@
{{ if .Site.Params.umamiScriptUrl }}
{{ if .Site.Params.umamiWebsiteId }}
<script
async
defer
data-website-id="{{ .Site.Params.umamiWebsiteId }}"
src="{{ .Site.Params.umamiScriptUrl }}"
></script>
{{ end }}
{{ end }}