🔖 Release next version of Cloudflare WebAnalytics
This commit is contained in:
parent
982e009441
commit
9050b7aa54
|
@ -8,7 +8,7 @@ configuration:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
imports:
|
imports:
|
||||||
- path: gitlab.com/toby3d/hugo/cloudflare
|
- path: gitlab.com/toby3d/hugo/cloudflare
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, connect and configure the necessary/all modules.
|
Then, connect and configure the necessary/all modules.
|
||||||
|
@ -30,9 +30,12 @@ params:
|
||||||
Inject `cloudflare/web-analytics` partial in your `<body>` (preferably as close as possible to the closing tag):
|
Inject `cloudflare/web-analytics` partial in your `<body>` (preferably as close as possible to the closing tag):
|
||||||
|
|
||||||
```html
|
```html
|
||||||
|
<head>
|
||||||
|
{{ partialCached "cloudflare/web-analytics/head" . $.Site.Language.Lang }}
|
||||||
|
</head>
|
||||||
...
|
...
|
||||||
<body>
|
<body>
|
||||||
...
|
...
|
||||||
{{ partial "cloudflare/web-analytics" . }}
|
{{ partialCached "cloudflare/web-analytics/body" . $.Site.Language.Lang }}
|
||||||
</body>
|
</body>
|
||||||
```
|
```
|
|
@ -1,5 +1 @@
|
||||||
{{ with $.Site.Params.cloudflare.webAnalytics }}
|
{{ partialCached "cloudflare/web-analytics/body" . $.Site.Language.Lang }}
|
||||||
<!-- Cloudflare Web Analytics -->
|
|
||||||
<script defer src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon="{'token':'{{ . | safeJS }}'}"></script>
|
|
||||||
<!-- End Cloudflare Web Analytics -->
|
|
||||||
{{ end }}
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{{ if ne $.Site.IsServer true }}
|
||||||
|
{{ with $.Site.Params.cloudflare.webAnalytics }}
|
||||||
|
<script src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon="{'token':'{{ . | safeJS }}'}" defer></script>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{{ if ne $.Site.IsServer true }}
|
||||||
|
{{ with $.Site.Params.cloudflare.webAnalytics }}
|
||||||
|
<link rel="preconnect" href="https://static.cloudflareinsights.com" crossorigin="anonymous">
|
||||||
|
<link rel="preload" as="script" href="https://static.cloudflareinsights.com/beacon.min.js" type="text/javascript" crossorigin="anonymous">
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
Loading…
Reference in New Issue