From 2736df1a57c003d9f7e46ac90a1ab05b5187ba3d Mon Sep 17 00:00:00 2001
From: Philippe Vinchon <p.vinchon@gmail.com>
Date: Sun, 23 Feb 2020 23:14:53 +0000
Subject: [PATCH] Update baseof.html

Don't publish analytics events during development
Solution from https://discourse.gohugo.io/t/how-to-exclude-google-analytics-when-running-under-hugo-local-server/6092/34
---
 layouts/_default/baseof.html | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 57ef293..f5fa96e 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -74,6 +74,8 @@
   <script src="{{ . | relURL }}"></script>
   {{- end}}
 
-  {{ template "_internal/google_analytics_async.html" . }}
+    {{ if not .Site.IsServer }}
+      {{ template "_internal/google_analytics_async.html" . }}
+    {{ end }}
 </body>
 </html>
-- 
GitLab