Ver código fonte

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 anos atrás
pai
commit
6ac8506eec
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3
    1
      layouts/_default/baseof.html

+ 3
- 1
layouts/_default/baseof.html Ver arquivo

@@ -5,6 +5,8 @@
5 5
     {{ block "main" . -}}{{- end }}
6 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 11
   </body>
10 12
 </html>