Hugo Cloudflare Analytics 模块

Cloudflare Analytics 为您的网站提供免费、隐私至上的分析。

Modulegithub.com/hugomods/cloudflare-analytics
StatsGitHub Stars Used By Used By Used By Used By

安装

导入模块

1module:
2  imports:
3  - path: github.com/hugomods/cloudflare-analytics
1[module]
2  [[module.imports]]
3    path = 'github.com/hugomods/cloudflare-analytics'
1{
2   "module": {
3      "imports": [
4         {
5            "path": "github.com/hugomods/cloudflare-analytics"
6         }
7      ]
8   }
9}

导入模板

1<head>
2  {{ partialCached "hugomods/baidu-analytics/index" . .Params.analyze }}
3</head>

站点配置

params.services.cloudflare_analytics.token

名称上下文类型必填默认值版本示例
params.services.cloudflare_analytics.token-string----

Cloudflare beacon 凭证。

站点配置示例

hugo.yaml

1params:
2  services:
3    cloudflare_analytics:
4      token: XXXXXXXX

hugo.toml

1[params]
2  [params.services]
3    [params.services.cloudflare_analytics]
4      token = 'XXXXXXXX'

hugo.json

1{
2   "params": {
3      "services": {
4         "cloudflare_analytics": {
5            "token": "XXXXXXXX"
6         }
7      }
8   }
9}

页面参数

analyze

名称上下文类型必填默认值版本示例
analyze-boolean-true--

false 时,不追踪当前页。