helpers/handlebars-helper-asset — pull request #1 by sjparsons (2014-10-03 16:15:49+00:00)
Title: Use the page- rather than target-related asset property.

I'm using the helper in an Assemble layout. I've come across an issue where I have a target that includes files from more than one folder (different levels). The `option.assets` property used currently is only target-specific and doesn't change for each page. Therefore, in situations like mine, the asset path will not be created correctly. My pull request makes use of the fact that in the `options.pages` array, each page object has a property `assets` which is relative to the page, not the target.

Here's an example of the problem to help make things clearer.

## Example of the problem that is solved.

This is an excerpt from a Gruntfile.
...

assemble: {

options: {
...
},
target: {
files: [
{
expand: true,
cwd: 'my/src/',
src: ['index.hbs','*/*.hbs'],
ext: '.html',
dest: 'my/dest'
},
]
},
},

...

In this case, when you use {{asset name/of/file.ext}} it will work correctly for the file in `*/*.hbs` but will work incorrectly for `index.hbs`. This is because of the way that Assemble sets `options.assets`. It doesn't change on a per-file basis – only on a per-target basis.