浏览代码

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 5 年前
父节点
当前提交
6ac8506eec
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3
    1
      layouts/_default/baseof.html

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

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>