diff options
| author | Jui-Ch'i Lau <21096362+KurococLiu@users.noreply.github.com> | 2023-03-01 02:29:48 +0800 |
|---|---|---|
| committer | Jui-Ch'i Lau <21096362+KurococLiu@users.noreply.github.com> | 2023-03-01 02:29:48 +0800 |
| commit | a3d046ee3f4c5e5e1df67f74312bd7fea7521978 (patch) | |
| tree | 9a6e9e68470d808acbb7a9f6589cf9cc14d50a57 | |
| parent | 9c6a6c0de50de4ba66ca88de242b398218d8f825 (diff) | |
📰 Add: 支持umami统计
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | libs/Matcha.php | 4 | ||||
| -rw-r--r-- | libs/Options.php | 2 |
3 files changed, 7 insertions, 0 deletions
@@ -88,6 +88,7 @@ Matcha 主题采用[语义化版本 2.0.0](https://semver.org/lang/zh-CN/) 标å‡ [Fluidbox](http://terrymun.github.io/Fluidbox/demo/index.html) | [Throttle-Debounce](https://benalman.com/projects/jquery-throttle-debounce-plugin/) | [tocbot.js](https://tscanlin.github.io/tocbot/) +[umami](https://github.com/umami-software/umami) #### 矢量图 diff --git a/libs/Matcha.php b/libs/Matcha.php index b606840..2ab0978 100644 --- a/libs/Matcha.php +++ b/libs/Matcha.php @@ -393,6 +393,10 @@ class Matcha } //附加信息 if (Helper::options()->footerInfo!='') echo '<div class="footer-info">'.Helper::options()->footerInfo.'</div>'; + //umami + if (Helper::options()->umamiID!='') { + echo '<script async defer src="https://analytics.umami.is/script.js" data-website-id="'.Helper::options()->umamiID.'"></script>'; + } } /** diff --git a/libs/Options.php b/libs/Options.php index ef12f80..935a7be 100644 --- a/libs/Options.php +++ b/libs/Options.php @@ -59,6 +59,8 @@ function themeConfig($form) { $form->addInput($icpNum); $startDate = new Typecho_Widget_Helper_Form_Element_Text('startDate', NULL, date('Y-m-d'), _t('网站建立日期'), _t('用于显示在页脚的版权信息,以及计算网站建立时长,格式为 Y-m-d')); $form->addInput($startDate); + $umamiID = new Typecho_Widget_Helper_Form_Element_Text('umamiID', NULL, NULL, _t('umami Website ID'), _t('在这里填入对应域名的 <a rel="nofollow" target="_blank" href="https://cloud.umami.is/">Umami</a> Website ID(如 <code>9caf0ded-6e8e-409c-9ds4-231fe253a8ac</code> ),留空则不开启功能')); + $form->addInput($umamiID); /** * 进阶功能 |
