From bc317e1c76843402f26eb16137e2905a42573a09 Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Fri, 6 Mar 2026 14:14:59 +0100 Subject: [PATCH] fix: use isset to detect required args provided as empty arrays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Empty slices are falsy in Hugo, so the previous truthiness check on `index $namedargs $key` incorrectly raised an "expected value" error for required arguments passed as `[]`. Replace with `isset` which returns true whenever the key exists regardless of its value. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 --- layouts/_partials/utilities/InitArgs.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/layouts/_partials/utilities/InitArgs.html b/layouts/_partials/utilities/InitArgs.html index 28c16ce..f4a8cb9 100644 --- a/layouts/_partials/utilities/InitArgs.html +++ b/layouts/_partials/utilities/InitArgs.html @@ -187,8 +187,7 @@ {{ end }} {{ if and (not $skip) (not $val.optional) }} - {{ $check := index $namedargs $key }} - {{ if not $check }} + {{ if not (isset $namedargs $key) }} {{ $errmsg = $errmsg | append (printf "[%s] argument '%s': expected value" (or $structure $bookshop) $key) }} {{ $error = true }} {{ end }}