mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
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>
This commit is contained in:
@@ -76,6 +76,10 @@ disqusShortname = "yourdiscussshortname"
|
|||||||
[params.goatCounter]
|
[params.goatCounter]
|
||||||
code = "code"
|
code = "code"
|
||||||
|
|
||||||
|
# If you want to use Cloudflare Web Analytics(https://cloudflare.com) for analytics, add this section
|
||||||
|
[params.cloudflare]
|
||||||
|
token = "token"
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
category = "categories"
|
category = "categories"
|
||||||
series = "series"
|
series = "series"
|
||||||
|
|||||||
@@ -139,6 +139,10 @@
|
|||||||
{{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
|
{{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
|
||||||
{{- partial "analytics/goatcounter" . -}}
|
{{- partial "analytics/goatcounter" . -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if and .Site.Params.cloudflare .Site.Params.cloudflare.token }}
|
||||||
|
{{- partial "analytics/cloudflare" . -}}
|
||||||
|
{{ end }}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
4
layouts/partials/analytics/cloudflare.html
Normal file
4
layouts/partials/analytics/cloudflare.html
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<!-- 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 -->
|
||||||
@@ -137,6 +137,13 @@ models:
|
|||||||
- type: string
|
- type: string
|
||||||
name: code
|
name: code
|
||||||
label: URL for Goat Counter
|
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
|
- type: object
|
||||||
name: languages
|
name: languages
|
||||||
fields:
|
fields:
|
||||||
|
|||||||
Reference in New Issue
Block a user