colynb/gulp-swig — pull request #4 by timrwood (2014-01-03 18:16:36+00:00)
Title: Allowing data to be set from a callback per file.

This is an alternate solution to #2.

This allows you to define a callback for the `data` option which will be called per file.

```js
function getTemplateDataForFile (file) {
return {
some_property : file.propertySetByAnotherTask,
STATIC_URL : path.relative(file.base, pathToStaticAssets)
};
}
gulp.src('*.html')
.pipe(swig({
data : getTemplateDataForFile
}))
```