From 8b41f894559250951adf8cb84bcf90c794da8f57 Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Wed, 1 Oct 2025 13:48:43 +0800 Subject: [PATCH] fix(head): only load analytics when IsProduction --- layouts/partials/head.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 07b9dd1f..e0e3c316 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -186,7 +186,9 @@ {{ partial "schema.html" . }} {{/* Analytics */}} - {{ partial "analytics/main.html" .Site }} + {{ if hugo.IsProduction }} + {{ partial "analytics/main.html" . }} + {{ end }} {{/* Extend head - eg. for custom analytics scripts, etc. */}} {{ if templates.Exists "partials/extend-head.html" }}