Skip to content

Commit

Permalink
fix: remove deprecated site.GoogleAnalytics (#438)
Browse files Browse the repository at this point in the history
* fix: remove deprecated site.GoogleAnalytics

* ci: bump netlify Hugo version
  • Loading branch information
imfing authored Aug 18, 2024
1 parent 852a07b commit 2863a3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions layouts/partials/google-analytics.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{{/* site.GoogleAnalytics is deprecated in Hugo v0.120.0 */}}
{{/* it will be removed in a future version */}}
{{- $gtagID := "" -}}
{{- with site.GoogleAnalytics -}}{{ $gtagID = . }}{{- end -}}
{{- with site.Config.Services.GoogleAnalytics.ID -}}{{ $gtagID = . }}{{- end -}}

{{- with $gtagID }}
{{- with site.Config.Services.GoogleAnalytics.ID }}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ command = "cd exampleSite && hugo --gc --minify --themesDir ../.. -b ${DEPLOY_PR
ignore = "false"

[build.environment]
HUGO_VERSION = "0.126.1"
HUGO_VERSION = "0.132.2"
GO_VERSION = "1.22.3"
NODE_VERSION = "22.2.0"

0 comments on commit 2863a3a

Please sign in to comment.