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

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

merged 1 commit into from
Aug 18, 2024

Conversation

eskopp
Copy link
Contributor

@eskopp eskopp commented Aug 14, 2024

Fix:

ERROR deprecated: .Site.GoogleAnalytics was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0.
 Use .Site.Config.Services.GoogleAnalytics.ID instead.

ERROR deprecated: .Site.GoogleAnalytics was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.GoogleAnalytics.ID instead.
Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for hugo-hextra ready!

Name Link
🔨 Latest commit dd0c7a3
🔍 Latest deploy log https://app.netlify.com/sites/hugo-hextra/deploys/66bc8bb513a2410008139c2a
😎 Deploy Preview https://deploy-preview-435--hugo-hextra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

<!-- 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.

@imfing imfing changed the title .Site.Config.Services.GoogleAnalytics.ID fix: remove deprecated google analytics reference in head.html Aug 18, 2024
@imfing imfing merged commit 852a07b into imfing:main Aug 18, 2024
4 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants