diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 7020e38..751acf8 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -76,6 +76,10 @@ disqusShortname = "yourdiscussshortname" [params.goatCounter] code = "code" +# If you want to use Cloudflare Web Analytics(https://cloudflare.com) for analytics, add this section +[params.cloudflare] + token = "token" + [taxonomies] category = "categories" series = "series" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 1603d5f..8922879 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -139,6 +139,10 @@ {{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }} {{- partial "analytics/goatcounter" . -}} {{ end }} + + {{ if and .Site.Params.cloudflare .Site.Params.cloudflare.token }} + {{- partial "analytics/cloudflare" . -}} + {{ end }} diff --git a/layouts/partials/analytics/cloudflare.html b/layouts/partials/analytics/cloudflare.html new file mode 100644 index 0000000..d8a732f --- /dev/null +++ b/layouts/partials/analytics/cloudflare.html @@ -0,0 +1,4 @@ + + + diff --git a/stackbit.yaml b/stackbit.yaml index 65715fe..d7cfbd7 100644 --- a/stackbit.yaml +++ b/stackbit.yaml @@ -137,6 +137,13 @@ models: - type: string name: code label: URL for Goat Counter + - type: object + name: cloudflare + label: Cloudflare Web Analytics (optional) + fields: + - type: string + name: token + label: token for Cloudflare Web Analytics - type: object name: languages fields: