assemble/assemble — pull request #190 by doowb (2013-06-10 23:07:06+00:00)
Title: Adding examples for passing assemble.options to custom helpers and bumping version.

This PR adds some examples and bumps the version.

Any `assemble.options` are passed to custom helpers when the helper defines the `register` method.

Set up the assemble build in the `Gruntfile.js`:
```js
assemble: {
options: {
flatten: true,
assets: 'test/actual/assets'
},
custom_helpers: {
options: {
helpers: ['test/lib/**/*.js'],
version: '<%= pkg.version %>'
},
files: {
'test/actual/custom_helpers.html': ['test/custom_helpers/custom_helpers.hbs']
}
}
}
```

In the `helpers` folder I have a file that registers a custom `opt` helper to get a property from the `assemble.options` object and return it:
```js
module.exports.register = register = function(Handlebars, options) {

Handlebars.registerHelper('opt', function(key) {
return options[key] || '';
});

};
```
This helper can now be used in a Handlebars template like this:

Version: {{opt 'version'}}

This code is all available in this PR