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,7 +1,7 @@
{{ warnf "_internal/google_analytics_async.html is no longer supported by Google and will be removed in a future version of Hugo" }}
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
{{- if not $pc.Disable -}}
{{ with .Site.GoogleAnalytics }}
{{ with .Site.Config.Services.GoogleAnalytics.ID }}
<script type="application/javascript">
{{ template "__ga_js_set_doNotTrack" $ }}
if (!doNotTrack) {