From 3dbaf7f30ee80e384339c825040909b5a547f97e Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Mon, 31 Aug 2026 10:44:11 +0200 Subject: [PATCH 1/3] fix(styles): keep visually-hidden out of the purge mod-simple-datatables hides the search input's label - which merely repeats the input's own placeholder - by passing a `visually-hidden` span as the label text. That class then lives only inside the module's JavaScript, so hugo_stats.json never records it and PurgeCSS drops it. Core layouts emit the class too, but only on pages that render a button, spinner or carousel. A site with none of those would purge the rule and put the duplicated label back on screen, in production builds only. Safelist it alongside the other classes SimpleDatatables applies at runtime. The exampleSite config re-exports this one, so both are covered. Co-Authored-By: Claude Opus 5 (1M context) --- config/postcss.config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/postcss.config.js b/config/postcss.config.js index 878d3869c..88fc7e4e3 100644 --- a/config/postcss.config.js +++ b/config/postcss.config.js @@ -64,7 +64,14 @@ const purgecss = purgeCSSPlugin({ 'search-input', // Bootstrap utilities used by SimpleDatatables 'float-right', - 'float-left' + 'float-left', + // mod-simple-datatables hides the search input's label, which would otherwise repeat + // the input's own placeholder, by passing a `visually-hidden` span as the label text. + // That class therefore only ever appears inside the module's JavaScript, never in a + // layout, so hugo_stats.json cannot record it. Core layouts happen to emit it too, but + // only on pages that render a button, spinner or carousel - a site with none of those + // would purge the class and put the duplicated label back on screen. + 'visually-hidden' ], // Classes with these patterns will be preserved along with their children deep: [ From eb367871026bd537cdb05d038bd73e1cc9dabcea Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Mon, 31 Aug 2026 10:53:18 +0200 Subject: [PATCH 2/3] fix(test): vendor Hugo modules before the template tests `pnpm test` fails on a tree that has never been vendored: the template tests build tests/templates, which resolves mod-utils partials through `_vendor`, so a fresh clone or worktree dies on "utilities/InitArgs.html not found". CI never hit this because build:cache vendors first and only then calls test:templates - the gap is local, and the husky pre-commit hook runs straight into it. Bind the dependency to the script that actually needs it rather than to `test`, so a direct `pnpm test:templates` is covered too. `mod:vendor` is the conditional wrapper, so this is a no-op once `_vendor` is current. Co-Authored-By: Claude Opus 5 (1M context) --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index fe58cdaab..69a53ebe2 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "mod:vendor": "node scripts/mod-vendor.cjs", "mod:vendor:force": "rimraf _vendor && hugo mod vendor", "test": "npm-run-all lint test:templates", + "pretest:templates": "pnpm mod:vendor", "test:templates": "hugo -s tests/templates --logLevel error", "env": "hugo env", "precheck": "npm version", From b8a5241c5e1f7f5af91552853d6198df56faf190 Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Mon, 31 Aug 2026 11:13:50 +0200 Subject: [PATCH 3/3] fix(deps): adopt mod-simple-datatables v4.2.1 Delivers the hidden, localized search label. v4.2.0 left the library's `labels.searchLabel` at its hard-coded English default, so every data table rendered a visible "Search" above the search input that merely repeated the input's own placeholder. v4.2.1 replaces it with a `visually-hidden` span driven by i18n, and localizes `labels.sortHint` alongside it. This is what fixes demo.gethinode.com, which is built from the exampleSite in production. Landing it with the purge safelist entry in one release keeps the class the module now depends on from ever shipping unguarded. Co-Authored-By: Claude Opus 5 (1M context) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index f43e821d1..b53335921 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/gethinode/mod-leaflet/v3 v3.1.3 // indirect github.com/gethinode/mod-lottie/v3 v3.0.4 // indirect github.com/gethinode/mod-mermaid/v5 v5.0.4 // indirect - github.com/gethinode/mod-simple-datatables/v4 v4.2.0 // indirect + github.com/gethinode/mod-simple-datatables/v4 v4.2.1 // indirect github.com/gethinode/mod-utils/v6 v6.11.0 // indirect github.com/nextapps-de/flexsearch v0.0.0-20260529083235-f7ed963096a0 // indirect github.com/twbs/bootstrap v5.3.8+incompatible // indirect diff --git a/go.sum b/go.sum index ba0a77ca9..1b43b435b 100644 --- a/go.sum +++ b/go.sum @@ -42,6 +42,8 @@ github.com/gethinode/mod-simple-datatables/v4 v4.1.1 h1:Bidf8FA9SxBBb163D0yteTya github.com/gethinode/mod-simple-datatables/v4 v4.1.1/go.mod h1:irmXKx2jeppfpGRsCC91vN8dA4U2nQfy2eW8bajUeJo= github.com/gethinode/mod-simple-datatables/v4 v4.2.0 h1:n1GyPqVQ6o44awWIAiAwg/xZ6LYYQZuTQk6CuagboeI= github.com/gethinode/mod-simple-datatables/v4 v4.2.0/go.mod h1:bIYh9MBNdBe5vzSfmymqVzdVh+RSA7yPbMfnIayg8eo= +github.com/gethinode/mod-simple-datatables/v4 v4.2.1 h1:Se1TIpqzOGcQVLZ2K8Ud7GuoEuVj/gk1zRqZ0jOR0UA= +github.com/gethinode/mod-simple-datatables/v4 v4.2.1/go.mod h1:X9j8YEPhKWhcPCdylQHwfNkAqLH8L9878XcHQLyGEc8= github.com/gethinode/mod-utils/v6 v6.7.0 h1:DxqKUb13/6ydcntGIrUj1YD892VwarB8zGj+77CeUwM= github.com/gethinode/mod-utils/v6 v6.7.0/go.mod h1:E5tO9w3VKaidJpu1nI8zAKmh0bddFHOIIQnudAaXQTs= github.com/gethinode/mod-utils/v6 v6.8.0 h1:Rz/6DlPKVW0791jSsobxx4I4pKQ38H4JOEeOV+GeRzU=