From ddd777846559db11ba0d71b5e60be8bd0c345640 Mon Sep 17 00:00:00 2001 From: kendo5731 Date: Fri, 3 Apr 2020 12:48:44 +0200 Subject: [PATCH] exclude google analytics when running under hugo local server --- layouts/partials/head.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b517fd1..66029c0 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -29,5 +29,8 @@ {{ with .OutputFormats.Get "RSS" }} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end }} - {{ template "_internal/google_analytics.html" . }} + + {{- if not .Site.IsServer -}} + {{ template "_internal/google_analytics.html" . }} + {{- end -}}