From e9ec93a471d9a753db01b682e75c52b32adf16f2 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Thu, 18 Feb 2021 21:44:01 +0100 Subject: use LoveIt theme, self hosted --- .../LoveIt/layouts/partials/plugin/analytics.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 themes/LoveIt/layouts/partials/plugin/analytics.html (limited to 'themes/LoveIt/layouts/partials/plugin/analytics.html') diff --git a/themes/LoveIt/layouts/partials/plugin/analytics.html b/themes/LoveIt/layouts/partials/plugin/analytics.html new file mode 100644 index 0000000..c4c21fa --- /dev/null +++ b/themes/LoveIt/layouts/partials/plugin/analytics.html @@ -0,0 +1,22 @@ +{{- $analytics := .Scratch.Get "analytics" | default dict -}} + +{{- if $analytics.enable -}} + {{- /* Google Analytics */ -}} + {{- with $analytics.google.id -}} + + {{- printf "https://www.googletagmanager.com/gtag/js?id=%v" . | dict "Async" true "Source" | partial "plugin/script.html" -}} + {{- end -}} + + {{- /* Fathom Analytics */ -}} + {{- with $analytics.fathom.id -}} + + {{- dict "Source" ($analytics.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "Async" true "Attr" "id=fathom-script" | partial "plugin/script.html" -}} + {{- end -}} +{{- end -}} -- cgit v1.2.3