hugo/tpl
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
..
cast Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
collections Add some basic security policies with sensible defaults 2021-12-16 09:40:22 +01:00
compare Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
crypto Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
data Add some basic security policies with sensible defaults 2021-12-16 09:40:22 +01:00
debug Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
encoding Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
fmt Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
hugo Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
images Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
inflect Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
internal Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
js Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
lang Fix description of lang.FormatNumberCustom 2021-11-01 18:54:43 +01:00
math Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
openapi/openapi3 Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
os Add some basic security policies with sensible defaults 2021-12-16 09:40:22 +01:00
partials Allow for return partials with falsy arguments (#9298) 2021-12-17 08:35:21 +01:00
path tpl/path: Add path.Clean 2021-10-05 16:15:10 +02:00
reflect Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
resources Allow user to handle/ignore errors in resources.Get 2021-12-10 11:10:41 +01:00
safe Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
site Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
strings Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
templates Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
time tpl/time: Use configured location when date passed to Format is string 2021-10-30 16:09:38 +02:00
tplimpl Allow for return partials with falsy arguments (#9298) 2021-12-17 08:35:21 +01:00
transform Add some basic security policies with sensible defaults 2021-12-16 09:40:22 +01:00
urls Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
template.go all: Fix minor typos 2020-12-16 12:11:32 +01:00
template_info.go Add render template hooks for links and images 2019-12-18 11:44:40 +01:00
template_test.go Create lightweight forks of text/template and html/template 2019-12-12 09:59:34 +01:00