diff --git a/README.md b/README.md index 6d9b8c46..fc14b3a6 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ I hope you will LoveIt ❤️! * Optimized for **performance**: 99/100 on mobile and 100/100 on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) * 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 * 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 f5163d6c..6fd3bdce 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -782,6 +782,11 @@ enableEmoji = true yandex = "" pinterest = "" baidu = "" + [params.fathomAnalytics] + # siteID = "ABC123" + # If you're self hosting use this for your tracker + # serverURL = "https://example.com" + # CSS and JS Files CDN # CSS 和 JS 文件的 CDN 设置 [params.cdn] diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index be676a9d..d8952a0b 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -264,4 +264,8 @@ {{- /* Google analytics async */ -}} {{- if eq hugo.Environment "production" | and .Site.GoogleAnalytics -}} {{- template "_internal/google_analytics_async.html" . -}} -{{- end -}} + + {{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }} + {{- partial "plugin/analytics/fathom" . -}} + {{ end }} +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/plugin/analytics/fathom.html b/layouts/partials/plugin/analytics/fathom.html new file mode 100644 index 00000000..89210b9a --- /dev/null +++ b/layouts/partials/plugin/analytics/fathom.html @@ -0,0 +1,13 @@ + \ No newline at end of file