fixe issue with analytics and new hugo update

This commit is contained in:
Nuno Coração
2023-05-24 22:43:31 +01:00
parent b64e7fc6d5
commit 2b3b34fab9
458 changed files with 17527 additions and 2592 deletions
+4 -3
View File
@@ -1,10 +1,11 @@
{{ if hugo.IsProduction }}
{{ with .Site.Params.fathomAnalytics.site }}
{{ if not hugo.IsProduction }}
{{ with site.Params.fathomAnalytics.site }}
{{ if isset $.Site.Params.fathomanalytics "domain" }}
<script defer src="https://{{ $.Site.Params.fathomanalytics.domain }}/script.js" data-site="{{ . }}"></script>
{{ else }}
<script defer src="https://cdn.usefathom.com/script.js" data-site="{{ . }}"></script>
{{ end }}
{{ end }}
{{ template "_internal/google_analytics.html" . }}
{{/* template "_internal/google_analytics.html" . */}}
{{ partial "ga-analytics.html" }}
{{ end }}
+10
View File
@@ -0,0 +1,10 @@
{{ if site.Config.Services.GoogleAnalytics.ID }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.Config.Services.GoogleAnalytics.ID }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.Config.Services.GoogleAnalytics.ID }}');
</script>
{{ end }}
+1 -1
View File
@@ -113,7 +113,7 @@
{{/* Vendor */}}
{{ partial "vendor.html" . }}
{{/* Analytics */}}
{{ partialCached "analytics.html" .Site }}
{{ partial "analytics.html" .Site }}
{{/* Extend head - eg. for custom analytics scripts, etc. */}}
{{ if templates.Exists "partials/extend-head.html" }}
{{ partialCached "extend-head.html" .Site }}