From 83869e0fc82356011bb155370d51a4ce3e6924c9 Mon Sep 17 00:00:00 2001 From: Dillon Date: Tue, 12 May 2020 20:51:07 +0800 Subject: [PATCH] feat(analytics): update Google analytics.js to gtag.js (#349) --- exampleSite/config.toml | 3 --- .../content/posts/theme-documentation-basics.en.md | 2 -- .../content/posts/theme-documentation-basics.fr.md | 2 -- .../content/posts/theme-documentation-basics.zh-cn.md | 2 -- layouts/_default/baseof.html | 2 +- layouts/partials/plugin/analytics.html | 10 ++++------ 6 files changed, 5 insertions(+), 16 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 0041afe0..f590e6d6 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -975,9 +975,6 @@ enableEmoji = true # whether to anonymize IP # 是否匿名化用户 IP anonymizeIP = true - # whether to use cookie - # 是否使用 cookie - cookie = false # Fathom Analytics [params.analytics.fathom] id = "" diff --git a/exampleSite/content/posts/theme-documentation-basics.en.md b/exampleSite/content/posts/theme-documentation-basics.en.md index 8aba8385..9980639b 100644 --- a/exampleSite/content/posts/theme-documentation-basics.en.md +++ b/exampleSite/content/posts/theme-documentation-basics.en.md @@ -596,8 +596,6 @@ Please open the code block below to view the complete sample configuration :(far id = "" # whether to anonymize IP anonymizeIP = true - # whether to use cookie - cookie = false # Fathom Analytics [params.analytics.fathom] id = "" diff --git a/exampleSite/content/posts/theme-documentation-basics.fr.md b/exampleSite/content/posts/theme-documentation-basics.fr.md index 3c6a4aca..a9a5d652 100644 --- a/exampleSite/content/posts/theme-documentation-basics.fr.md +++ b/exampleSite/content/posts/theme-documentation-basics.fr.md @@ -601,8 +601,6 @@ Please open the code block below to view the complete sample configuration :(far id = "" # whether to anonymize IP anonymizeIP = true - # whether to use cookie - cookie = false # Fathom Analytics [params.analytics.fathom] id = "" diff --git a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md index b68bb026..f5b5db0d 100644 --- a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md @@ -599,8 +599,6 @@ hugo id = "" # 是否匿名化用户 IP anonymizeIP = true - # 是否使用 cookie - cookie = false # Fathom Analytics [params.analytics.fathom] id = "" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a196159c..4bcabfd8 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,3 +1,4 @@ +{{- .Scratch.Set "version" "0.2.7" -}} {{- $version := "0.2.X" -}} {{- /* LoveIt theme version detection */ -}} @@ -10,7 +11,6 @@ {{- end -}} {{- $params := .Params | merge .Site.Params.page -}} -{{- .Scratch.Set "version" "0.2.6" -}} {{- if eq hugo.Environment "production" -}} {{- .Scratch.Set "cdn" .Site.Params.cdn -}} diff --git a/layouts/partials/plugin/analytics.html b/layouts/partials/plugin/analytics.html index 7714da6d..ec2eb9a0 100644 --- a/layouts/partials/plugin/analytics.html +++ b/layouts/partials/plugin/analytics.html @@ -2,18 +2,16 @@ {{- /* Google Analytics */ -}} {{- with .google.id -}} - {{- dict "source" "https://www.google-analytics.com/analytics.js" "async" true | partial "plugin/script.html" -}} + {{- printf "https://www.googletagmanager.com/gtag/js?id=%s" . | dict "async" true "source" | partial "plugin/script.html" -}} {{- end -}} {{- /* Fathom Analytics */ -}} {{- with .fathom.id -}}