From 67cf24cf42a79d5c8a691ff7b0af9bf968d9724a Mon Sep 17 00:00:00 2001 From: zloylinux Date: Sat, 12 Jul 2025 19:05:59 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(analytics):=20make=20Umami=20D?= =?UTF-8?q?NT=20behavior=20configurable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 3 +++ themes/tabi/templates/partials/analytics.html | 2 +- themes/tabi/theme.toml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index f424262..4538c6a 100644 --- a/config.toml +++ b/config.toml @@ -265,6 +265,9 @@ service = "goatcounter" id = "zloy" #self_hosted_url = "https://zloy.goatcounter.com" +# Optional: For Umami, enable this option to respect users' Do Not Track (DNT) settings. The default is true. +do_not_track = true + [extra.isso] enabled_for_all_posts = true # Enables Isso on all posts. It can be enabled on individual posts by setting `isso = true` in the [extra] section of a post's front matter. automatic_loading = true # If set to false, a "Load comments" button will be shown. diff --git a/themes/tabi/templates/partials/analytics.html b/themes/tabi/templates/partials/analytics.html index 794e61b..6a5d30e 100644 --- a/themes/tabi/templates/partials/analytics.html +++ b/themes/tabi/templates/partials/analytics.html @@ -25,7 +25,7 @@ data-website-id="{{ analytics_id }}" src="https://cloud.umami.is/script.js" {% endif %} - data-do-not-track="true"> + {% if config.extra.analytics.do_not_track %}data-do-not-track="true"{% endif %}> {% elif analytics_service == "plausible" %} diff --git a/themes/tabi/theme.toml b/themes/tabi/theme.toml index 6649e55..c3e195b 100644 --- a/themes/tabi/theme.toml +++ b/themes/tabi/theme.toml @@ -320,6 +320,9 @@ custom_subset = true # Leave this field empty if you're using the service's default hosting. # self_hosted_url = "" +# Optional: For Umami, enable this option to respect users' Do Not Track (DNT) settings. The default is true. +do_not_track = true + # giscus support for comments. https://giscus.app # Setup instructions: https://welpo.github.io/tabi/blog/comments/#setup [extra.giscus]