hugo/cloudflare
Maxim Lebedev 788762fc52
🎨 Format cf partials
2021-05-12 22:22:36 +05:00
..
layouts/partials 🎨 Format cf partials 2021-05-12 22:22:36 +05:00
README.md 🔖 Release next version of Cloudflare WebAnalytics 2021-04-23 17:57:00 +05:00
config.yaml Added Cloudflare WebAnalytics module 2020-12-25 21:03:49 +05:00
go.mod Added Cloudflare WebAnalytics module 2020-12-25 21:03:49 +05:00

README.md

Cloudflare

Cloudflare tools for compiled Hugo-website.

Install

Config

Import module in your site
configuration:

imports:
  - path: gitlab.com/toby3d/hugo/cloudflare

Then, connect and configure the necessary/all modules.

Web Analytics

See the official Cloudflare documentation
about how it works and how to get the token.

Install

Config

baseUrl: https://example.com/
params:
  cloudflare:
    webAnalytics: 1d59a54b73a94728a4a9ed1b09767b1f

Template

Inject cloudflare/web-analytics partial in your <body> (preferably as close as possible to the closing tag):

<head>
  {{ partialCached "cloudflare/web-analytics/head" . $.Site.Language.Lang }}
</head>
...
<body>
  ...
  {{ partialCached "cloudflare/web-analytics/body" . $.Site.Language.Lang }}
</body>