diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d51156b..b992ca2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -71,3 +71,4 @@ - [Endormi](https://endormi.io) - [Rajiv Ranjan Singh](https://iamrajiv.github.io/) - [Pakhomov Alexander](https://github.com/PakhomovAlexander) +- [Rhys Perry](https://rhysperry.com) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d2e54a2..c95ec45 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -60,6 +60,12 @@ disqusShortname = "yourdiscussshortname" siteID = "ABCDE" # Default value is cdn.usefathom.com, overwrite this if you are self-hosting serverURL = "analytics.example.com" + +# If you want to use plausible(https://plausible.io) for analytics, add this section +[params.plausibleAnalytics] + domain = "example.com" + # Default value is plausible.io, overwrite this if you are self-hosting or using a custom domain + serverURL = "analytics.example.com" [taxonomies] category = "categories" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 825fccd..389275d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -127,6 +127,10 @@ {{- partial "analytics/fathom" . -}} {{ end }} + {{ if and .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }} + {{- partial "analytics/plausible" . -}} + {{ end }} + diff --git a/layouts/partials/analytics/plausible.html b/layouts/partials/analytics/plausible.html new file mode 100644 index 0000000..d36ba4b --- /dev/null +++ b/layouts/partials/analytics/plausible.html @@ -0,0 +1 @@ + diff --git a/stackbit.yaml b/stackbit.yaml index dd3592f..1050376 100644 --- a/stackbit.yaml +++ b/stackbit.yaml @@ -114,6 +114,16 @@ models: - type: string name: serverURL label: URL for Fathom Analytics + - type: object + name: plausibleAnalytics + label: Plausible Analytics (optional) + fields: + - type: string + name: domain + label: Website domain for Plausible Analytics + - type: string + name: serverURL + label: URL for Plausible Analytics - type: object name: languages fields: