Closed eishundo closed 8 months ago
@eishundo Thank you for pointing this out. We can keep backward compatibility by checking Hugo version using hugo.Version
function.
Hello there! I've encountered the same issue. After updating the theme, I lost the functionality of Google Analytics. However, I followed your advice and it's been fixed. In my case, I didn't have the layouts folder in my repository. I downloaded it from the main repository, applied the changes, and it works now.
I see the fix was released, but I believe we also need to modify line 8 in the file.
{{ $analyticsConfig := dict (slice "Site" "GoogleAnalytics") .id }}
Should be:
{{ $analyticsConfig := dict (slice "Site" "Config" "Services" "GoogleAnalytics" "ID") .id }}
Should be fixed in #937
Question
Heads-up.
I spent some time updating my build from an older version of Hugo and Toha v3.8.0 to the latest Hugo version with Toha v4.0.0 (great work on the theme update!).
I noticed Hugo now reports:
My GoogleAnalytics script was not being added to the rendered pages at all.
Tactically, I have overridden the theme by creating "layouts/partials/analytics.html" containing the following changes:
However, this may break sites using older versions of Hugo, so I didn't want to submit a formal patch.
I also noticed a similar warning for Disqus, but do not use this site so unable to troubleshoot. e.g.
References: