alanshaw / grunt-include-replace

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

Variable name shows up when not defined #51

Closed dloewen closed 9 years ago

dloewen commented 9 years ago

Instead of showing the variable name in the processed page, it would be nice to output nothing when the variable is not defined.

For example, I have a header.html include that gets a @@title variable passed in on all pages except for the home page, but @@title shows up in the title tag since it's not defined.

The workaround is to define it and leave it blank like this: @@include('header.html', {"title": ""}), but it would be easier to leave that out.

alanshaw commented 9 years ago

Could you set a blank global? - https://github.com/alanshaw/grunt-include-replace#optionsglobals

dloewen commented 9 years ago

That works great, thanks @alanshaw!