New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial lookups no longer take into account paths. #84
Comments
hi keeto i just created the same issue (#83) i temporary rolled back to a earlier commit. |
will focus on #83 . |
Now this is fixed you may refer to #83 , thanks. |
I'm still having issues with this. :( This used to work:
Should this still be supported behaviour? |
Well ...... Partials are logical pieces in mustache/handlebars . For example, when it be executed at browser / client side / none file system environments , you can not expect it auto turn into file system naming logic. You can organize partial in different directories . In handlebars.js the partial works just like this way:
When you {{>foo}} it works very well, but you can not use {{>./foo}} , because it means find a partial named as './foo' . You may test the behavior here: http://jsfiddle.net/8735c/ , try to change {{>foo}} to {{>./foo}} . So, should we extend the partial support to 'relative path resolve on file system' ? Basically it can be done in lightncandy , maybe it works in old version of lightncandy , but it is not standard.....supporting on it may cause problems when you rendering at client side or using other handlebars implements. |
My plan is stopping support the relative path . If it works, the behavior is not guaranteed. |
I'd rather have it as an option, or a flag perhaps. |
Hmmmm........
Then {{>bar}} will get first hit of /usr/local/share/handlebars/templates/bar.tmpl , /usr/local/share/handlebars/templates/path1/bar.tmpl , /usr/local/share/handlebars/templates/path2/bar.tmpl . But, you really need to deal with partial name very carefully to prevent name conflicted. If this solution can not resolve your use case, may you show me more about your scenario ? Thanks. |
Actually, I just realized that this is a pretty specific use-case for us. It's a bit too complicated to explain why we're in this situation, but it boils down to fancy file resolution that we want. I think it'll be unreasonable for me to ask for a pretty specific solution, since this is a very specific problem that we have. One way we can solve this is to subclass LightnCandy and override the necessary lookup methods. This would work, but it'll be a bit of a complication if you decide to change any of the APIs. It would be really awesome if we could refactor
|
Ya good, I will work on this enhancement later , thank you for the specific design. |
Upon checking the current head, the following no longer works:
when compiled with the following:
The file
some-partial
is located insome_path/to/templates/partials/some-partial
. This used to work some time ago, but now silently fails to compile. Is this new behaviour?The text was updated successfully, but these errors were encountered: