chore: support services.googleAnalytics.ID (#173)

* chore: support `services.googleAnalytics.ID`

and deprecate `site.googleAnalytics`

* chore: remove warning
This commit is contained in:
Xin
2023-10-30 19:48:48 -04:00
committed by GitHub
parent de1286c7fc
commit e3f6069968
4 changed files with 16 additions and 6 deletions

View File

@ -25,7 +25,7 @@
<!-- Google Analytics -->
{{- if and .Site.GoogleAnalytics (eq hugo.Environment "production") }}
{{- if and (eq hugo.Environment "production") (or .Site.GoogleAnalytics .Site.Config.Services.GoogleAnalytics.ID) }}
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
{{ partial "google-analytics.html" . }}
{{- end }}