rockwood/grunt-templater — pull request #5 by twolfson (2013-03-30 09:55:13+00:00)
Title: Add support for dynamic variables

I love this module but have always had trouble with `watch` scripts and this. Sometimes I use dynamic file content within my templates and need to implement some cache-busting mechanism to work around it.

I am submitting this pull request to allow for dynamic resolution of variables each time we compile. It adds the functionality that if `variables`, it will run it and use its output.

```js
dynamicVariables: {
src: 'app/homepage.jade',
dest: 'dist/index.html',
variables: function () {
css: grunt.file.read('app.min.css'),
now: new Date()
}
}
```

Here is an example of me using this fork:
https://github.com/twolfson/pinboard.in-button/blob/131f366483b753d3a5ce6edb25a38b2c629aca8f/grunt.js#L38-L51