From 9050b7aa54dabaf9b59684fedc3116192616f4f7 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Fri, 23 Apr 2021 17:57:00 +0500 Subject: [PATCH] :bookmark: Release next version of Cloudflare WebAnalytics --- cloudflare/README.md | 9 ++++++--- cloudflare/layouts/partials/web-analytics.html | 6 +----- cloudflare/layouts/partials/web-analytics/body.html | 5 +++++ cloudflare/layouts/partials/web-analytics/head.html | 6 ++++++ 4 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 cloudflare/layouts/partials/web-analytics/body.html create mode 100644 cloudflare/layouts/partials/web-analytics/head.html diff --git a/cloudflare/README.md b/cloudflare/README.md index 28ece47..33d5004 100644 --- a/cloudflare/README.md +++ b/cloudflare/README.md @@ -8,7 +8,7 @@ configuration: ```yaml imports: -- path: gitlab.com/toby3d/hugo/cloudflare + - path: gitlab.com/toby3d/hugo/cloudflare ``` Then, connect and configure the necessary/all modules. @@ -30,9 +30,12 @@ params: Inject `cloudflare/web-analytics` partial in your `` (preferably as close as possible to the closing tag): ```html + + {{ partialCached "cloudflare/web-analytics/head" . $.Site.Language.Lang }} + ... ... - {{ partial "cloudflare/web-analytics" . }} + {{ partialCached "cloudflare/web-analytics/body" . $.Site.Language.Lang }} -``` +``` \ No newline at end of file diff --git a/cloudflare/layouts/partials/web-analytics.html b/cloudflare/layouts/partials/web-analytics.html index 3c8025d..f8addc0 100644 --- a/cloudflare/layouts/partials/web-analytics.html +++ b/cloudflare/layouts/partials/web-analytics.html @@ -1,5 +1 @@ -{{ with $.Site.Params.cloudflare.webAnalytics }} - - - -{{ end }} \ No newline at end of file +{{ partialCached "cloudflare/web-analytics/body" . $.Site.Language.Lang }} \ No newline at end of file diff --git a/cloudflare/layouts/partials/web-analytics/body.html b/cloudflare/layouts/partials/web-analytics/body.html new file mode 100644 index 0000000..0aa3d64 --- /dev/null +++ b/cloudflare/layouts/partials/web-analytics/body.html @@ -0,0 +1,5 @@ +{{ if ne $.Site.IsServer true }} + {{ with $.Site.Params.cloudflare.webAnalytics }} + + {{ end }} +{{ end }} \ No newline at end of file diff --git a/cloudflare/layouts/partials/web-analytics/head.html b/cloudflare/layouts/partials/web-analytics/head.html new file mode 100644 index 0000000..686000a --- /dev/null +++ b/cloudflare/layouts/partials/web-analytics/head.html @@ -0,0 +1,6 @@ +{{ if ne $.Site.IsServer true }} + {{ with $.Site.Params.cloudflare.webAnalytics }} + + + {{ end }} +{{ end }} \ No newline at end of file