From 5c968f59a21c976bc9a636df52bac68dcda38a6b Mon Sep 17 00:00:00 2001 From: Reorx Date: Thu, 19 May 2022 16:15:32 +0800 Subject: [PATCH] support custom analytics --- layouts/partials/head.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 9b50504..e7c02b3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -72,7 +72,12 @@ {{- /* Misc */}} {{- if hugo.IsProduction | or (eq site.Params.env "production") }} -{{- template "_internal/google_analytics.html" . }} + {{- if site.GoogleAnalytics }} + {{- template "_internal/google_analytics.html" . }} + {{- end -}} + {{- if site.Params.useCustomAnalytics }} + {{- partialCached "custom_analytics.html" . "custom_analytics.html" }} + {{- end -}} {{- end -}} {{- /* https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started */}}