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

Mario Rimann
21 hours ago 42b3cb29f49a6787c2147233a0598d16c6c7cf77
fix: remove duplicate inclusion of the footer.html (#591)

* Remove duplicate inclusion of the footer.html

* fix: render footer scripts once while keeping mobile footer

Restore the base footer include (only visible on mobile) and move the
medium-zoom and analytics includes from footer.html into baseof.html,
so they are emitted once per page instead of once per footer instance.

Fixes #574

---------

Co-authored-by: Markus Bilz <github@markusbilz.com>
2 files modified
15 ■■■■■ changed files
layouts/_default/baseof.html 8 ●●●●● patch | view | raw | blame | history
layouts/partials/footer.html 7 ●●●●● patch | view | raw | blame | history
layouts/_default/baseof.html
@@ -35,6 +35,14 @@
    {{- partial "footer.html" (dict "context" . "footerClassModifier" "base") -}}
    {{- partial "medium-zoom.html" . -}}
    {{- if (hasPrefix .Site.Config.Services.GoogleAnalytics.ID "G-") -}}
      {{- template "_internal/google_analytics.html" . -}}
    {{- end -}}
    {{- if and (hugo.IsProduction) (.Site.Params.gtagId) -}}
      {{ partial "google-analytics-gtag-async.html" . }}
    {{- end -}}
    {{- if (eq .Site.Params.simpleAnalytics.enable true) -}}
      {{- partial "analytics/simpleanalytics.html" . -}}
    {{- end -}}
layouts/partials/footer.html
@@ -41,10 +41,3 @@
    {{ 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 }}
{{- end -}}