From 3807bf5915ab199ad08df47aa4068de479c9f343 Mon Sep 17 00:00:00 2001 From: Nimrod Gutman Date: Fri, 17 Jul 2020 12:15:40 +0300 Subject: [PATCH] add support for Plausible Analytics --- README.md | 1 + exampleSite/config.toml | 3 +++ layouts/partials/plugin/analytics.html | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 76a9d149..1c25b18f 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ I hope you will LoveIt ❤️! * Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD * **[Google Analytics](https://analytics.google.com/analytics)** supported * **[Fathom Analytics](https://usefathom.com/)** supported +* **[Plausible Analytics](https://plausible.io/)** supported * Search engine **verification** supported (Google, Bind, Yandex and Baidu) * **CDN** for third-party libraries supported * Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d87632c1..e49be1c7 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -999,6 +999,9 @@ enableEmoji = true # server url for your tracker if you're self hosting # 自行托管追踪器时的主机路径 server = "" + # Plausible Analytics + [params.analytics.plausible] + dataDomain = "" # Cookie consent config # Cookie 许可配置 diff --git a/layouts/partials/plugin/analytics.html b/layouts/partials/plugin/analytics.html index c4c21fad..944d3d6a 100644 --- a/layouts/partials/plugin/analytics.html +++ b/layouts/partials/plugin/analytics.html @@ -19,4 +19,9 @@ {{- dict "Source" ($analytics.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "Async" true "Attr" "id=fathom-script" | partial "plugin/script.html" -}} {{- end -}} + + {{- /* Plausible Analytics */ -}} + {{- with $analytics.plausible.dataDomain -}} + + {{- end -}} {{- end -}}