Skip to content

Commit

Permalink
Update 404.html
Browse files Browse the repository at this point in the history
Google Analytics async template is deprecated:

https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/google_analytics_async.html#L1

I've also wrapped it in an `if` statement so it doesn't track non-production environments.
  • Loading branch information
pobtastic authored Mar 15, 2024
1 parent ce4bafd commit 046f314
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ <h4 class="mb-0">Didn’t find anything here!</h4>

</div>
{{ partial "footer.html" . }}
{{ template "_internal/google_analytics_async.html" . }}
<!-- Google Analytics -->
{{ if eq (getenv "HUGO_ENV") "production"}}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
</body>

</html>

0 comments on commit 046f314

Please sign in to comment.