From bc919dfece5e7c294a58ea9688a99632cfaf5e6f Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Sat, 8 Aug 2026 19:27:20 +0200 Subject: [PATCH] Wire up hugo_cookie_consent's banner and script includes The theme's baseof.html only loads the consent banner and its JS if the site fills in the body_extra/scripts_extra hook partials; neither existed, so the banner never rendered and the JS 404'd when the "change cookie preferences" button tried to call it. Also bumps hugo_cookie_consent to v0.0.10, which logs a clear console error if the banner element is ever missing again, and drops an unused stray privacyPolicyURL param left over from debugging. Co-Authored-By: Claude Sonnet 5 --- config/_default/params.yaml | 2 -- go.mod | 4 ++-- go.sum | 2 ++ layouts/_partials/body_extra.html | 1 + layouts/_partials/scripts_extra.html | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 layouts/_partials/body_extra.html create mode 100644 layouts/_partials/scripts_extra.html diff --git a/config/_default/params.yaml b/config/_default/params.yaml index c7a44b3..23e5b92 100644 --- a/config/_default/params.yaml +++ b/config/_default/params.yaml @@ -5,5 +5,3 @@ hugo_cookie_consent: enable_tracking: true matomo_host: https://matomo.bovender.de matomo_site_id: 3 - - diff --git a/go.mod b/go.mod index 3ad6c89..a5e166a 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ -module git.bovender.de/daniel/xltoolbox.net.git +module git.bovender.de/daniel/xltoolbox.net go 1.26.3 require ( git.bovender.de/daniel/hugo_bootstrap_theme v0.0.8 // indirect - git.bovender.de/daniel/hugo_cookie_consent v0.0.6 // indirect + git.bovender.de/daniel/hugo_cookie_consent v0.0.10 // indirect ) diff --git a/go.sum b/go.sum index 3ee92cf..d786565 100644 --- a/go.sum +++ b/go.sum @@ -2,3 +2,5 @@ git.bovender.de/daniel/hugo_bootstrap_theme v0.0.8 h1:20U5sQ6YHbG6YP/+5+WcBkf8oB git.bovender.de/daniel/hugo_bootstrap_theme v0.0.8/go.mod h1:iLp7PY+cH8Cszxxx6XDGVS9kPdkH5qKdoUhIDQMpS+g= git.bovender.de/daniel/hugo_cookie_consent v0.0.6 h1:q3AEinytbYYFIZ3hHIcmU+T+imEGBMQeaVXJIlhz8Po= git.bovender.de/daniel/hugo_cookie_consent v0.0.6/go.mod h1:XTLK60q7Zlhjtw84Toe0l8C1tgPaVKcWRluceaig0o0= +git.bovender.de/daniel/hugo_cookie_consent v0.0.10 h1:ehf1ZHTkgIVPafpmD9nLnI/8XBOW6pm28Xk04CdBUEk= +git.bovender.de/daniel/hugo_cookie_consent v0.0.10/go.mod h1:XTLK60q7Zlhjtw84Toe0l8C1tgPaVKcWRluceaig0o0= diff --git a/layouts/_partials/body_extra.html b/layouts/_partials/body_extra.html new file mode 100644 index 0000000..0d0c7c2 --- /dev/null +++ b/layouts/_partials/body_extra.html @@ -0,0 +1 @@ +{{ partial "hugo_cookie_consent/banner.html" . }} diff --git a/layouts/_partials/scripts_extra.html b/layouts/_partials/scripts_extra.html new file mode 100644 index 0000000..9f37a47 --- /dev/null +++ b/layouts/_partials/scripts_extra.html @@ -0,0 +1 @@ +{{ partial "hugo_cookie_consent/scripts.html" . }}