hugo/tpl/partials
Paul Gottschling 5758c370ea
Allow for return partials with falsy arguments (#9298)
Partials with returns values are parsed, then inserted into a
partial return wrapper via wrapInPartialReturnWrapper in order
to assign the return value via *contextWrapper.Set. The
predefined wrapper template for partials inserts a partial's nodes
into a "with" template action in order to set dot to a
*contextWrapper within the partial. However, because "with" is
skipped if its argument is falsy, partials with falsy arguments
were not being evaluated.

This replaces the "with" action in the partial wrapper with a
"range" action that isn't skipped if .Arg is falsy.

Fixes #7528
2021-12-17 08:35:21 +01:00
..
init.go Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
init_test.go Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
partials.go Allow for return partials with falsy arguments (#9298) 2021-12-17 08:35:21 +01:00
partials_test.go all: Format code with gofumpt 2020-12-03 13:12:58 +01:00