From c933777d44847c7cc5637fe9c9829e069fd705d4 Mon Sep 17 00:00:00 2001 From: Regis Philibert Date: Thu, 5 Nov 2020 11:52:56 -0500 Subject: [PATCH] Prevent non-zero arg on returning partial As of Hugo .75 returning partial now requires a non-zero argument. --- partials/private/parse.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/partials/private/parse.html b/partials/private/parse.html index 1a62209..3ab5538 100644 --- a/partials/private/parse.html +++ b/partials/private/parse.html @@ -46,11 +46,15 @@ {{ $origin := . }} {{/* We range on it via key and value */}} {{ range $key, $value := . }} - {{/* As it's a not a slice, there is no potential imports, we can directly use parse */}} - {{ with partialCached "tnd-netlifycms/private/parse" . . }} - {{/* We merge the produced data with the newly created $map */}} - {{ if ne . $value }} - {{ $map = merge $map (dict $key .) }} + {{/* As it's a not a slice, there is no potential imports, we can directly use parse + We make sure the value is not emtpy. As of Hugo .75 returning partial now requires a non-zero argument + */}} + {{ with . }} + {{ with partialCached "tnd-netlifycms/private/parse" . . }} + {{/* We merge the produced data with the newly created $map */}} + {{ if ne . $value }} + {{ $map = merge $map (dict $key .) }} + {{ end }} {{ end }} {{ end }} {{ end }}