From bf11d5a74493dfa1544d76c5e26b0fc605376727 Mon Sep 17 00:00:00 2001 From: Qiming Teng Date: Sat, 18 Jul 2020 21:27:57 +0800 Subject: [PATCH] Disable analytics for non-production environment The analytics code/link is not always working. It takes about 33 seconds to fail when building local sites for testing, and that is terrible. This PR disables the analytics in non-production environment, so local build starts up in seconds! --- layouts/partials/git-info.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/git-info.html b/layouts/partials/git-info.html index d37a47dd77..2f01fd8d28 100644 --- a/layouts/partials/git-info.html +++ b/layouts/partials/git-info.html @@ -3,9 +3,11 @@
+ {{ if eq (getenv "HUGO_ENV") "production" }}

Analytics

+ {{ end }} {{ if and (ne .Kind "404") (not (strings.Contains .Path "search")) }} {{ if not .Params.no_issue }}