Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for return partials with falsy arguments #9298

Merged
merged 2 commits into from
Dec 17, 2021
Merged

Commits on Dec 17, 2021

  1. Allow for return partials with falsy arguments

    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 gohugoio#7528
    ptgott committed Dec 17, 2021
    Configuration menu
    Copy the full SHA
    449d1dd View commit details
    Browse the repository at this point in the history
  2. Address PR feedback

    ptgott committed Dec 17, 2021
    Configuration menu
    Copy the full SHA
    4708b1e View commit details
    Browse the repository at this point in the history