瀏覽代碼

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 年之前
父節點
當前提交
6ac8506eec
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3
    1
      layouts/_default/baseof.html

+ 3
- 1
layouts/_default/baseof.html 查看文件

@@ -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>