From 2007d5f709378368019bdef7d1c9f13d8e89536d Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Sun, 12 Jul 2026 14:06:35 +0200 Subject: [PATCH] feat: adopt the mod-utils v6 validation engine Bump the module's own path to /v3 and require mod-utils v6.0.1 (never v6.0.0, which carries a known camelKey defect). Migrate the sole InitArgs.html call site (layouts/shortcodes/map.html) to the clean Args.html API with strict false, since it is a user-facing shortcode. Update config.toml and exampleSite/hugo.toml module import paths and re-vendor. hugo mod graph (exampleSite context) shows mod-utils/v6 v6.0.1 only, no v5. The exampleSite build exits 0 with zero warnings attributable to the map shortcode. Rendered HTML for the exampleSite's existing map call (real content, not a placeholder) is byte-identical before and after the migration. A visual regression run against the module's own exampleSite (3 pages) reports 0 flagged pages at 0.0000% diff. BREAKING CHANGE: requires github.com/gethinode/mod-leaflet/v3 import path; adopts mod-utils v6 and migrates argument handling to the Args API (see gethinode/mod-utils v5-to-v6 migration notes). Co-Authored-By: Claude Fable 5 --- config.toml | 2 +- exampleSite/hugo.toml | 2 +- go.mod | 4 ++-- go.sum | 2 ++ layouts/shortcodes/map.html | 13 +++++++------ 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/config.toml b/config.toml index fc0ab92..385c5f8 100644 --- a/config.toml +++ b/config.toml @@ -28,7 +28,7 @@ source = 'static' target = 'static' [[module.imports]] - path = "github.com/gethinode/mod-utils/v5" + path = "github.com/gethinode/mod-utils/v6" [params.modules.leaflet] integration = "optional" diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 74600da..22852c7 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -5,7 +5,7 @@ title = 'Test site for mod-leaflet' [module] workspace = "mod-leaflet.work" [[module.imports]] - path = "github.com/gethinode/mod-leaflet/v2" + path = "github.com/gethinode/mod-leaflet/v3" [[module.imports.mounts]] source = "data" target = "data" diff --git a/go.mod b/go.mod index 1635837..d0b43f6 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ -module github.com/gethinode/mod-leaflet/v2 +module github.com/gethinode/mod-leaflet/v3 go 1.19 -require github.com/gethinode/mod-utils/v5 v5.19.0 // indirect +require github.com/gethinode/mod-utils/v6 v6.0.1 // indirect diff --git a/go.sum b/go.sum index a97a363..0608106 100644 --- a/go.sum +++ b/go.sum @@ -10,3 +10,5 @@ github.com/gethinode/mod-utils/v5 v5.0.0 h1:iF8FtgzQu9BW7R94sJ77gltSZO2QkAv60EMN github.com/gethinode/mod-utils/v5 v5.0.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= github.com/gethinode/mod-utils/v5 v5.19.0 h1:fX3gTsYoimUNqD/KeBsyBrrJ2DygQ0M7Rc8gL1HT5Tc= github.com/gethinode/mod-utils/v5 v5.19.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= +github.com/gethinode/mod-utils/v6 v6.0.1 h1:EnmMHjqnI/xyHPXFj1SdRLfVxNunJcKLGVtSAAFTQ8w= +github.com/gethinode/mod-utils/v6 v6.0.1/go.mod h1:E5tO9w3VKaidJpu1nI8zAKmh0bddFHOIIQnudAaXQTs= diff --git a/layouts/shortcodes/map.html b/layouts/shortcodes/map.html index a0ddd09..b3cc4b6 100644 --- a/layouts/shortcodes/map.html +++ b/layouts/shortcodes/map.html @@ -7,17 +7,18 @@ {{ $error := false }} {{/* Validate and initialize arguments */}} -{{ $args := partial "utilities/InitArgs.html" (dict "structure" "map" "args" .Params "named" .IsNamedParams "group" "shortcode") }} -{{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict - "partial" "shortcodes/map.html" +{{ $result := partial "utilities/Args.html" (dict "structure" "map" "args" .Params "named" .IsNamedParams "group" "shortcode" "strict" false) }} +{{ $args := $result.args }} +{{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + "partial" "shortcodes/map.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File "position" .Position )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{ end }} {{/* Initialize local arguments */}}