hugolib: Deprecate .Site.GoogleAnalytics

Use .Site.Config.Services.GoogleAnalytics.ID instead.
This commit is contained in:
Joe Mooring
2023-10-16 11:31:09 -07:00
committed by Bjørn Erik Pedersen
parent d4016dd5cd
commit a692278bc6
7 changed files with 55 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
{{- if not $pc.Disable }}{{ with .Site.GoogleAnalytics -}}
{{- if not $pc.Disable }}{{ with .Site.Config.Services.GoogleAnalytics.ID -}}
{{ if hasPrefix . "G-"}}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
@@ -48,4 +48,4 @@ var doNotTrack = false;
var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
var doNotTrack = (dnt == "1" || dnt == "yes");
{{- end -}}
{{- end -}}
{{- end -}}