carlitoplatanito / gulp-nunjucks-render

[Gulp](https://github.com/wearefractal/gulp) plugin to render [Nunjucks](http://mozilla.github.io/nunjucks/) templates
149 stars 33 forks source link

Default keyword arguments don't work on macros #60

Closed revelt closed 6 years ago

revelt commented 7 years ago

According to documentation here and here, you can set the defaults within macros:

{% macro field(name, value='', type='text') %}

I discovered that default values don't work on gulp-nunjucks-renderer: when I set them, I get blank values. In the example snippet above, I'd be getting empty value, even if non-empty variable were being passed into it.

Can anybody confirm please, do you see this happening?

cheers

TheDancingCode commented 6 years ago

It works over here.

value is the second parameter, so make sure to pass it in the right order. e.g.:

{{ field('my name', 'my value', 'my type') }} 
revelt commented 6 years ago

@TheDancingCode aha! Thank you

revelt commented 6 years ago

It's funny no action for a year, it's not like maintainers didn't have time to address that, it's more of a time management and allocating certain amount of minutes per day and prioritising the issues... On other hand, the GitHub doesn't have any tools to help package maintainers - for example, out of all the libraries you have admin access, out of all their active issues, which ones are oldest? All that via single interface..