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

How to manage tags configuration? #40

Closed fstn closed 8 years ago

fstn commented 8 years ago

I try to change default tags: gulp.task('default', function () { return gulp.src('src/templates/*.html') .pipe(nunjucksRender({ tags: { blockStart: '<%', blockEnd: '%>', variableStart: '<$', variableEnd: '$>', commentStart: '<#', commentEnd: '#>' }, path: ['src/templates/'] // String or Array })) .pipe(gulp.dest('dist')); });

it doesn't work

thanks

carlitoplatanito commented 8 years ago

@fstn you can set this in the config stage...

nunjucksRender.nunjucks.configure('src/templates/', {
  tags: {
    blockStart: '<%',
    blockEnd: '%>',
    variableStart: '<$',
    variableEnd: '$>',
    commentStart: '<#',
    commentEnd: '#>'
  }
});

gulp.task('default', function () { 
  return gulp.src('src/templates/*.html')
    .pipe(nunjucksRender({
      path: ['src/templates/']
    }))
   .pipe(gulp.dest('dist'));
});

If it works, feel free to close this out.