Partials should be relative to views, not dirname(path)#112
Partials should be relative to views, not dirname(path)#112
Conversation
Partials are currently read relative to the dirname of the template you're rendering, not the views directory. This means that when you're rendering views/subfolder/page the partials in views/partials won't load correctly.
|
I personally always render |
|
Just seems like you set a views folder as the "root" for a reason, so the partials should use that same "root", not be relative to whatever file you're sending. The trouble comes w/ template inheritance, which I'm doing in Hogan: views/layouts/default.html {{$content}}{{/content}}views/backend/base.html -> extends default So when I render 'backend/base' with consolidate, the basic layout partials don't load properly because they're relative to 'views/backend' not 'views/' |
|
Yes I understand your problem, my point was that someone else may expect the partials paths to be relative to the rendered template. The same is true if you want your partials to have absolute paths for some reason. |
|
Closing in favor of #86 |
Partials are currently read relative to the dirname of the template
you're rendering, not the views directory. This means that when you're
rendering views/subfolder/page the partials in views/partials won't
load correctly.