Browse Source

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
Philippe Vinchon 4 years ago
parent
commit
6ac8506eec
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      layouts/_default/baseof.html

+ 3
- 1
layouts/_default/baseof.html View File

5
     {{ block "main" . -}}{{- end }}
5
     {{ block "main" . -}}{{- end }}
6
     </main>
6
     </main>
7
 
7
 
8
-    {{ template "_internal/google_analytics_async.html" . }}
8
+    {{ if not .Site.IsServer }}
9
+      {{ template "_internal/google_analytics_async.html" . }}
10
+    {{ end }}
9
   </body>
11
   </body>
10
 </html>
12
 </html>