alanshaw / grunt-include-replace

Grunt task to include files and replace variables. Allows for parameterised includes.
MIT License
200 stars 45 forks source link

Allow undeclared parameters to be defaulted #66

Open D-B-S opened 8 years ago

D-B-S commented 8 years ago

It would be really useful if you could set any null parameters to a default value. For instance:

snippet.html could contain:

<p>@@one</p>
<p>@@two</p>

And be included via: @@include("snippet.html", {"one":"text"})

Currently, as nothing is passed in for @@two this will will display:

text
@@two

It would be nice to be able to define a default value for parameters, so any missing parameters can be treated as a blank string by default (or have some default text entered) rather than showing the unused @@ variable in the output.