From 426d84dd818d94ab41ffa321e0df635217b91e94 Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Mon, 13 Jul 2026 16:26:48 +0200 Subject: [PATCH 1/2] fix(preview): stop caching the embedding verdict indefinitely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hugo caches remote resources forever by default (caches.getresource maxAge -1), and the Netlify cache plugin carries that cache from build to build. The preview component reads a target's response headers to decide whether it can be embedded, so a stale entry pins the verdict to whatever the target sent the first time it was fetched. That is not hypothetical: the showcase previews on gethinode.com stayed on their fallback screenshots after both sides of the embed were corrected and the site was rebuilt, because the build re-read the old headers out of the cache. Recovering needs a cache-cleared deploy, and nothing in the build says so. Cap the lifetime at 5 minutes. Builds are further apart than that, so the headers are re-read on every build, while a single build still fetches each one only once. Also upgrade mod-leaflet to v3.1.0, which gives the map cooperative gestures: the map on /docs/components/map trapped page scroll until now. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) --- config/_default/hugo.toml | 12 ++++++++++++ exampleSite/go.mod | 1 + exampleSite/go.sum | 2 ++ go.mod | 2 +- go.sum | 2 ++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 40ebe509..eb4f13b9 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -180,3 +180,15 @@ home = ["HTML", "RSS", "REDIR", "netlify", "server", "searchindex"] kind = '{home}' output = '{netlify,server}' # toml-docs-end segments + +# toml-docs-start caches +[caches] + # Hugo caches remote resources forever by default, and the Netlify cache plugin carries that + # cache across builds. The preview component reads a target's response headers to decide whether + # it can be embedded, so a stale entry pins the verdict to whatever the target sent the first + # time it was fetched: correcting a target's CSP then no longer takes effect on a rebuild. + # Builds are further apart than this, so headers are re-read on every build while still being + # fetched only once within one. + [caches.getresource] + maxAge = "5m" +# toml-docs-end caches diff --git a/exampleSite/go.mod b/exampleSite/go.mod index 7893c518..2e6e5a3c 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -10,6 +10,7 @@ require ( github.com/gethinode/mod-cookieyes/v2 v2.2.6 // indirect github.com/gethinode/mod-docs v1.15.0 // indirect github.com/gethinode/mod-fontawesome/v6 v6.0.0 // indirect + github.com/gethinode/mod-leaflet/v3 v3.1.0 // indirect github.com/gethinode/mod-utils/v6 v6.4.0 // indirect github.com/twbs/icons v1.13.1 // indirect ) diff --git a/exampleSite/go.sum b/exampleSite/go.sum index f10a96f0..43cb03ff 100644 --- a/exampleSite/go.sum +++ b/exampleSite/go.sum @@ -18,6 +18,8 @@ github.com/gethinode/mod-docs v1.15.0 h1:A/iJ2S2v8Le0u8gdOfpLoss8mDaaJI+gtMNXiws github.com/gethinode/mod-docs v1.15.0/go.mod h1:ru1w0fHqFocjDIMV0dm40OwhBw5k4UncCS8iO/1S5kI= github.com/gethinode/mod-fontawesome/v6 v6.0.0 h1:PrfiMfVEAM5Lpnkp+sXOtOdRSOe3l56z+ngrPcACzlA= github.com/gethinode/mod-fontawesome/v6 v6.0.0/go.mod h1:ayMslv2xpC5cjxUVTkIlFBbOd1LM5ezIr0OSOr6q8Gk= +github.com/gethinode/mod-leaflet/v3 v3.1.0 h1:zscIv/q2dg0TUjosjM9hB9DchlutuWkWqOafX00fsKI= +github.com/gethinode/mod-leaflet/v3 v3.1.0/go.mod h1:FsoyVRb3DRZBb2jWPV4yJNqbmOKmCwaJgom2hbWZXnA= github.com/gethinode/mod-utils/v6 v6.4.0 h1:l49KrawKE/7c6XE00wXQ9T5/kuTfiETerBz6OWn3SJc= github.com/gethinode/mod-utils/v6 v6.4.0/go.mod h1:E5tO9w3VKaidJpu1nI8zAKmh0bddFHOIIQnudAaXQTs= github.com/twbs/icons v1.13.1 h1:6bmNXvoeIbvjFWjfbjXg5JGbelLD1haIsMaEIzE9UZI= diff --git a/go.mod b/go.mod index 4856be70..1e45aa67 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gethinode/mod-fontawesome/v6 v6.0.0 // indirect github.com/gethinode/mod-google-analytics/v2 v2.0.3 // indirect github.com/gethinode/mod-katex v1.1.5 // indirect - github.com/gethinode/mod-leaflet/v3 v3.0.0 // indirect + github.com/gethinode/mod-leaflet/v3 v3.1.0 // indirect github.com/gethinode/mod-lottie/v3 v3.0.0 // indirect github.com/gethinode/mod-mermaid/v5 v5.0.0 // indirect github.com/gethinode/mod-simple-datatables/v4 v4.0.0 // indirect diff --git a/go.sum b/go.sum index 9ece4265..51b83d8b 100644 --- a/go.sum +++ b/go.sum @@ -88,6 +88,8 @@ github.com/gethinode/mod-leaflet/v2 v2.1.1 h1:8g0T9hN036LsCaXFkehDlzFbEpAlSYrzxS github.com/gethinode/mod-leaflet/v2 v2.1.1/go.mod h1:A9Inp9uwSDD6vW8uYVVGl6eXGMe+j3ESOxV4T53HOaM= github.com/gethinode/mod-leaflet/v3 v3.0.0 h1:rNjdruvS08bxqsLFEWNt9aU2KCbHiRlEKpKIutqWVOw= github.com/gethinode/mod-leaflet/v3 v3.0.0/go.mod h1:FsoyVRb3DRZBb2jWPV4yJNqbmOKmCwaJgom2hbWZXnA= +github.com/gethinode/mod-leaflet/v3 v3.1.0 h1:zscIv/q2dg0TUjosjM9hB9DchlutuWkWqOafX00fsKI= +github.com/gethinode/mod-leaflet/v3 v3.1.0/go.mod h1:FsoyVRb3DRZBb2jWPV4yJNqbmOKmCwaJgom2hbWZXnA= github.com/gethinode/mod-lottie/v2 v2.0.1 h1:jIY5oGHtkXXvJoxNAE2AueoqxqNNlTYHF4+igQmkIAU= github.com/gethinode/mod-lottie/v2 v2.0.1/go.mod h1:/YzhRcG9H8MyODt8qaOQP0nqoux7EFHW2S7ugiiFf0o= github.com/gethinode/mod-lottie/v2 v2.1.0 h1:d0ViSsZr8idst7/zWTjCHp93jdX9fPHeGaAHEhi7lO4= From d63fdd999aeb8a61085e9defc8303097d7887a87 Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Mon, 13 Jul 2026 16:38:16 +0200 Subject: [PATCH 2/2] build(deps): upgrade mod-docs to v1.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v1.15.1 documents the cooperative gestures that mod-leaflet v3.1.0 introduces, so the demo's map page describes the behaviour it now has rather than the behaviour it used to have. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) --- exampleSite/go.mod | 2 +- exampleSite/go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/exampleSite/go.mod b/exampleSite/go.mod index 2e6e5a3c..327040f0 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -8,7 +8,7 @@ require ( github.com/gethinode/mod-blocks/v2 v2.1.0 // indirect github.com/gethinode/mod-bootstrap-icons/v2 v2.0.0 // indirect github.com/gethinode/mod-cookieyes/v2 v2.2.6 // indirect - github.com/gethinode/mod-docs v1.15.0 // indirect + github.com/gethinode/mod-docs v1.15.1 // indirect github.com/gethinode/mod-fontawesome/v6 v6.0.0 // indirect github.com/gethinode/mod-leaflet/v3 v3.1.0 // indirect github.com/gethinode/mod-utils/v6 v6.4.0 // indirect diff --git a/exampleSite/go.sum b/exampleSite/go.sum index 43cb03ff..4917e03b 100644 --- a/exampleSite/go.sum +++ b/exampleSite/go.sum @@ -16,6 +16,8 @@ github.com/gethinode/mod-docs v1.14.1 h1:+G8IjMi/krhAzvOlB5ODnfQCp6b5ixWyU3D7f/8 github.com/gethinode/mod-docs v1.14.1/go.mod h1:ru1w0fHqFocjDIMV0dm40OwhBw5k4UncCS8iO/1S5kI= github.com/gethinode/mod-docs v1.15.0 h1:A/iJ2S2v8Le0u8gdOfpLoss8mDaaJI+gtMNXiws7SyE= github.com/gethinode/mod-docs v1.15.0/go.mod h1:ru1w0fHqFocjDIMV0dm40OwhBw5k4UncCS8iO/1S5kI= +github.com/gethinode/mod-docs v1.15.1 h1:WSmJWWhbiXeRkNqYRnZMBT5GkMDaJsijYC6YZzMcvkA= +github.com/gethinode/mod-docs v1.15.1/go.mod h1:ru1w0fHqFocjDIMV0dm40OwhBw5k4UncCS8iO/1S5kI= github.com/gethinode/mod-fontawesome/v6 v6.0.0 h1:PrfiMfVEAM5Lpnkp+sXOtOdRSOe3l56z+ngrPcACzlA= github.com/gethinode/mod-fontawesome/v6 v6.0.0/go.mod h1:ayMslv2xpC5cjxUVTkIlFBbOd1LM5ezIr0OSOr6q8Gk= github.com/gethinode/mod-leaflet/v3 v3.1.0 h1:zscIv/q2dg0TUjosjM9hB9DchlutuWkWqOafX00fsKI=