simon-dt / gulp-twig

Twig plugin for gulp.js, The streaming build system. Looking for maintainer or collaborators. See wiki
https://github.com/zimmen/gulp-twig/wiki/Looking-for-maintainer-or-collaborator(s)
MIT License
62 stars 33 forks source link

Make the vinyl file available as template variable. #9

Closed tristanlins closed 9 years ago

tristanlins commented 9 years ago

The vinyl file is now available as _file variable. The _target variable has two properties, the _target.path contains the full target path and _target.relative contains the relative target path.

I find this really useful, when piping multiple templates through gulp like this:

gulp.task('build-pages', function () {
    return gulp
        .src(['pages/**/*.twig'], {base: 'pages'})
        .pipe(twig(...))
        ...;
});
simon-dt commented 9 years ago

Well, merged somewhat. I have added some testing and repositioned some stuff because I have let some PR's open way too long and merged them in a funky order. Sorry about that.