]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl: Trim whitespace from google_analytics.html
authorPatrice Chalin <chalin@users.noreply.github.com>
Thu, 29 Aug 2024 19:32:46 +0000 (15:32 -0400)
committerGitHub <noreply@github.com>
Thu, 29 Aug 2024 19:32:46 +0000 (21:32 +0200)
tpl/tplimpl/embedded/templates/google_analytics.html

index b8930d4bd277b70f9eeca76cd63df1fe281a82db..49856630fee91fac0b9e2b36ce4d2b40b44355f5 100644 (file)
@@ -1,8 +1,8 @@
 {{ if not site.Config.Privacy.GoogleAnalytics.Disable }}
-  {{ with site.Config.Services.GoogleAnalytics.ID }}
-    {{ if strings.HasPrefix (lower .) "ua-" }}
-      {{ warnf "Google Analytics 4 (GA4) replaced Google Universal Analytics (UA) effective 1 July 2023. See https://support.google.com/analytics/answer/11583528. Create a GA4 property and data stream, then replace the Google Analytics ID in your site configuration with the new value." }}
-    {{ else }}
+  {{- with site.Config.Services.GoogleAnalytics.ID }}
+    {{- if strings.HasPrefix (lower .) "ua-" }}
+      {{- warnf "Google Analytics 4 (GA4) replaced Google Universal Analytics (UA) effective 1 July 2023. See https://support.google.com/analytics/answer/11583528. Create a GA4 property and data stream, then replace the Google Analytics ID in your site configuration with the new value." }}
+    {{- else }}
       <script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
       <script>
         var doNotTrack = false;
@@ -17,6 +17,6 @@
           gtag('config', '{{ . }}');
         }
       </script>
-    {{ end }}
-  {{ end }}
-{{ end }}
+    {{- end }}
+  {{- end }}
+{{- end -}}