From 6aac2deaedde258f8ffbc6b932d6fb190d32aa2b Mon Sep 17 00:00:00 2001 From: Nischay Ram Mamidi Date: Fri, 14 Oct 2022 22:51:22 -0400 Subject: [PATCH 1/2] feat: added supported for umami --- README.md | 1 + README.zh-cn.md | 1 + config.toml | 4 ++++ exampleSite/config.toml | 4 ++++ exampleSite/content/about/index.en.md | 1 + exampleSite/content/about/index.zh-cn.md | 1 + .../content/posts/theme-documentation-basics/index.en.md | 1 + .../content/posts/theme-documentation-basics/index.zh-cn.md | 5 ++++- layouts/partials/plugin/analytics.html | 6 ++++++ 9 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d0de81064..5d02012dd 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ I hope you will LoveIt ❤️! * **[Google Analytics](https://analytics.google.com/analytics)** supported * **[Fathom Analytics](https://usefathom.com/)** supported * **[Plausible Analytics](https://plausible.io/)** supported +* **[Umami Analytics](https://umami.is/)** supported * **[Yandex Metrica](https://metrica.yandex.com/)** supported * Search engine **verification** supported (Google, Bind, Yandex and Baidu) * **CDN** for third-party libraries supported diff --git a/README.zh-cn.md b/README.zh-cn.md index 1d76eb39f..8af4494e5 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -61,6 +61,7 @@ * 支持 **[Google Analytics](https://analytics.google.com/analytics)** * 支持 **[Fathom Analytics](https://usefathom.com/)** * 支持 **[Plausible Analytics](https://plausible.io/)** +* 支持 **[Umami Analytics](https://umami.is/)** * 支持 **[Yandex Metrica](https://metrica.yandex.com/)** * 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu) * 支持所有第三方库的 **CDN** diff --git a/config.toml b/config.toml index 7dd3b9def..8c89d5d07 100644 --- a/config.toml +++ b/config.toml @@ -579,6 +579,10 @@ # Plausible Analytics [params.analytics.plausible] dataDomain = "" + # Umami Analytics + [params.analytics.umami] + src = "" + dataWebsiteId = "" # Yandex Metrica [params.analytics.yandexMetrica] id = "" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 504cb9e90..c975ddab6 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -664,6 +664,10 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] # Plausible Analytics [params.analytics.plausible] dataDomain = "" + # Umami Analytics + [params.analytics.umami] + src = "" + dataWebsiteId = "" # Yandex Metrica [params.analytics.yandexMetrica] id = "" diff --git a/exampleSite/content/about/index.en.md b/exampleSite/content/about/index.en.md index 866fbf4f9..888f7ee0f 100644 --- a/exampleSite/content/about/index.en.md +++ b/exampleSite/content/about/index.en.md @@ -34,6 +34,7 @@ math: * :(fab fa-google fa-fw): **[Google Analytics](https://analytics.google.com/analytics)** supported * :(far fa-chart-bar fa-fw): **[Fathom Analytics](https://usefathom.com/)** supported * :(fas fa-chart-column fa-fw): **[Plausible Analytics](https://plausible.io/)** supported +* :(fas fa-chart-pie fa-fw): **[Umami Analytics](https://umami.is/)** supported * :(fab fa-yandex-international fa-fw): **[Yandex Metrica](https://metrica.yandex.com/)** supported * :(fas fa-sitemap fa-fw): Search engine **verification** supported (Google, Bind, Yandex and Baidu) * :(fas fa-tachometer-alt fa-fw): **CDN** for third-party libraries supported diff --git a/exampleSite/content/about/index.zh-cn.md b/exampleSite/content/about/index.zh-cn.md index 21fbe12d0..165b2aafb 100644 --- a/exampleSite/content/about/index.zh-cn.md +++ b/exampleSite/content/about/index.zh-cn.md @@ -34,6 +34,7 @@ math: * :(fab fa-google fa-fw): 支持 **[Google Analytics](https://analytics.google.com/analytics)** * :(far fa-chart-bar fa-fw): 支持 **[Fathom Analytics](https://usefathom.com/)** * :(fas fa-chart-column fa-fw): 支持 **[Plausible Analytics](https://plausible.io/)** +* :(fas fa-chart-pie fa-fw): 支持 **[Umami Analytics](https://umami.is/)** * :(fab fa-yandex-international fa-fw): 支持 **[Yandex Metrica](https://metrica.yandex.com/)** * :(fas fa-sitemap fa-fw): 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu) * :(fas fa-tachometer-alt fa-fw): 支持所有第三方库的 **CDN** diff --git a/exampleSite/content/posts/theme-documentation-basics/index.en.md b/exampleSite/content/posts/theme-documentation-basics/index.en.md index b961a25e5..0a8fb71cc 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.en.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.en.md @@ -723,6 +723,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] # Plausible Analytics [params.analytics.plausible] dataDomain = "" + # Yandex Metrica [params.analytics.yandexMetrica] id = "" diff --git a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md index edca2e26a..5a5d362ea 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md @@ -725,10 +725,13 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] # Plausible Analytics [params.analytics.plausible] dataDomain = "" + # Umami Analytics + [params.analytics.umami] + src = "" + dataWebsiteId = "" # Yandex Metrica [params.analytics.yandexMetrica] id = "" - # {{< version 0.2.7 >}} Cookie 许可配置 [params.cookieconsent] enable = true diff --git a/layouts/partials/plugin/analytics.html b/layouts/partials/plugin/analytics.html index 9b174ed17..db5b02b18 100644 --- a/layouts/partials/plugin/analytics.html +++ b/layouts/partials/plugin/analytics.html @@ -25,6 +25,11 @@ {{- dict "Source" "https://plausible.io/js/plausible.js" "Async" true "Defer" true "Attr" ($analytics.plausible.dataDomain | printf `data-domain="%v"`) | partial "plugin/script.html" -}} {{- end -}} + {{- /* Umami Analytics */ -}} + {{- with $analytics.umami.src -}} + {{- dict "Source" $analytics.umami.src "Async" true "Defer" true "Attr" ($analytics.umami.dataWebsiteId | printf `data-website-id="%v"`) | partial "plugin/script.html" -}} + {{- end -}} + {{- /* Yandex Metrica */ -}} {{- with $analytics.yandexMetrica.id -}} {{- end -}} + {{- end -}} From 7f167f1003f7857e29a77f4f697b52d58618fc90 Mon Sep 17 00:00:00 2001 From: Nischay Ram Mamidi Date: Fri, 14 Oct 2022 22:53:59 -0400 Subject: [PATCH 2/2] fix documentation and spacing --- .../content/posts/theme-documentation-basics/index.en.md | 5 ++++- .../content/posts/theme-documentation-basics/index.zh-cn.md | 1 + layouts/partials/plugin/analytics.html | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/exampleSite/content/posts/theme-documentation-basics/index.en.md b/exampleSite/content/posts/theme-documentation-basics/index.en.md index 0a8fb71cc..cc8e00da8 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.en.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.en.md @@ -723,7 +723,10 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] # Plausible Analytics [params.analytics.plausible] dataDomain = "" - + # Umami Analytics + [params.analytics.umami] + src = "" + dataWebsiteId = "" # Yandex Metrica [params.analytics.yandexMetrica] id = "" diff --git a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md index 5a5d362ea..04f682102 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md @@ -732,6 +732,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"] # Yandex Metrica [params.analytics.yandexMetrica] id = "" + # {{< version 0.2.7 >}} Cookie 许可配置 [params.cookieconsent] enable = true diff --git a/layouts/partials/plugin/analytics.html b/layouts/partials/plugin/analytics.html index db5b02b18..f1ae21f37 100644 --- a/layouts/partials/plugin/analytics.html +++ b/layouts/partials/plugin/analytics.html @@ -45,5 +45,4 @@ {{- end -}} - {{- end -}}