mirror of https://github.com/lxndrblz/anatole.git

copilot-swe-agent[bot]
4 days ago 32dbb9c716d46c000e8ba55ce4e43ca812241622
fix: guard footer scripts with Scratch to prevent double-tracking
1 files modified
15 ■■■■■ changed files
layouts/partials/footer.html 15 ●●●●● patch | view | raw | blame | history
layouts/partials/footer.html
@@ -41,10 +41,13 @@
    {{ end }}
  </ul>
</footer>
{{- partial "medium-zoom.html" .context -}}
{{- if (hasPrefix .context.Site.Config.Services.GoogleAnalytics.ID "G-") -}}
  {{- template "_internal/google_analytics.html" .context -}}
{{- end -}}
{{- if and (hugo.IsProduction) (.context.Site.Params.gtagId) -}}
  {{ partial "google-analytics-gtag-async.html" .context }}
{{- if not (.context.Scratch.Get "footerScriptsRendered") -}}
  {{- .context.Scratch.Set "footerScriptsRendered" true -}}
  {{- partial "medium-zoom.html" .context -}}
  {{- if (hasPrefix .context.Site.Config.Services.GoogleAnalytics.ID "G-") -}}
    {{- template "_internal/google_analytics.html" .context -}}
  {{- end -}}
  {{- if and (hugo.IsProduction) (.context.Site.Params.gtagId) -}}
    {{ partial "google-analytics-gtag-async.html" .context }}
  {{- end -}}
{{- end -}}