Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: remove deprecated google analytics reference in head.html #435

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
{{ partialCached "head-css.html" . }}


<!-- Google Analytics -->
{{- 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 }}

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need to update this place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the change is completely sufficient. Previously there was only a warning. Now, however, there is an error and the project crashes. The change is therefore necessary.

See here:

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, I only made the change I described. I then tested my private project. As there was no warning and no error, the issue was closed for me.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eskopp as I pointed out above, this PR didn't address all the locations where Site.GoogleAnalytics is referenced, thus it will not close the issue for me.

anyway, I will open a following PR to address this.

{{- end }}

<script>
/* Initialize light/dark mode */
Expand Down