mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
fixe issue with analytics and new hugo update
This commit is contained in:
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user