From 773637ddaf44c7dacb735fd235a820adee688aa7 Mon Sep 17 00:00:00 2001 From: Miguel de Benito Delgado Date: Sun, 31 Mar 2024 15:46:19 +0200 Subject: [PATCH] Don't render analytics with mkdocs serve --- .../analytics/simpleanalytics.html | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/overrides/partials/integrations/analytics/simpleanalytics.html b/docs/overrides/partials/integrations/analytics/simpleanalytics.html index de4cbb52f..37aee7ffa 100644 --- a/docs/overrides/partials/integrations/analytics/simpleanalytics.html +++ b/docs/overrides/partials/integrations/analytics/simpleanalytics.html @@ -1,10 +1,18 @@ - - - +{% set site_domain = config.site_url | replace('https://', '') | replace('http://', '') | trim('/') %} +{% set dev_domain = config.dev_addr | replace('https://', '') | replace('http://', '') | trim('/') %} +{% set develop = site_domain.startswith(dev_domain) %} +{% if not develop %} + {% set hostname = config.extra.analytics.hostname | default(site_domain) %} + {% set script_domain = config.extra.analytics.script_domain | default('scripts.simpleanalyticscdn.com') %} + {% set noscript_domain = config.extra.analytics.noscript_domain | default('queue.simpleanalyticscdn.com') %} + {% set collect_dnt = config.extra.analytics.collect_dnt | default('false') %} + + +{% endif %}