Add support of Cloudflare Web Analytics (#492)
* Add support of Cloudflare Web Analytics
* Update exampleSite/config.toml
Co-authored-by: Luiz F. A. de Prá <luizdepra@users.noreply.github.com>
Co-authored-by: Luiz F. A. de Prá <luizdepra@users.noreply.github.com>
1 files added
3 files modified
| | |
| | | [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" |
| | |
| | | {{ 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 }} |
| | | </body> |
| | | |
| | | </html> |
| New file |
| | |
| | | <!-- Cloudflare Web Analytics --> |
| | | <script defer src='https://static.cloudflareinsights.com/beacon.min.js' |
| | | data-cf-beacon='{"token": "{{ $.Site.Params.cloudflare.token }}"}'></script> |
| | | <!-- End Cloudflare Web Analytics --> |
| | |
| | | - 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: |