From 39831dcec2fb7f2d5c8314ab9a9c64b2ac12bfef Mon Sep 17 00:00:00 2001 From: xiongxiao Date: Mon, 19 Jan 2026 21:57:16 +0800 Subject: [PATCH] update add umami --- blog/themes/anzhiyu/_config.yml | 3 +++ blog/themes/anzhiyu/layout/includes/head/analytics.pug | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/blog/themes/anzhiyu/_config.yml b/blog/themes/anzhiyu/_config.yml index 4685e20..0dd03af 100644 --- a/blog/themes/anzhiyu/_config.yml +++ b/blog/themes/anzhiyu/_config.yml @@ -37,6 +37,9 @@ nav: link: https://image.anheyu.com/ icon: https://image.anheyu.com/favicon.ico +# umami analytics +umami_analytics: ffd1b3f8-8f0b-4137-b4ee-cb9500994870 + # mourn (哀悼日,指定日期网站简单变灰,不包括滚动条) # 注意: 仅网站首页变灰,其他页面正常显示 mourn: diff --git a/blog/themes/anzhiyu/layout/includes/head/analytics.pug b/blog/themes/anzhiyu/layout/includes/head/analytics.pug index 6452528..a4c5547 100644 --- a/blog/themes/anzhiyu/layout/includes/head/analytics.pug +++ b/blog/themes/anzhiyu/layout/includes/head/analytics.pug @@ -28,4 +28,7 @@ if theme.microsoft_clarity c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); - })(window, document, "clarity", "script", "!{theme.microsoft_clarity}"); \ No newline at end of file + })(window, document, "clarity", "script", "!{theme.microsoft_clarity}"); + +if theme.umami_analytics + script(defer src='https://umami.xiongxiao.me/script.js' data-website-id=theme.umami_analytics) \ No newline at end of file