handlebars_assets icon indicating copy to clipboard operation
handlebars_assets copied to clipboard

Prefix or path for partials?

Open andreasheim opened this issue 11 years ago • 2 comments

Is there a way to provide a common prefix for partials so that they can be used without a folder name?

E.g. partialsPath = 'templates/partials' or partialsDefaultPath

And then the partials can be used like

{{> partial-file-name}}

instead of

{{> partials/_partial-file-name}}

Obviously I could just put global partials in the templates folder, but that feels dirty.

(strip the underscore as well, but I could live with still needing it).

Apologies if I missed something obvious.

andreasheim avatar Oct 27 '14 23:10 andreasheim

@andreasheim you could do this in your own personal javascript; I am now wondering what I could support for this case though as well...

Getting proper name stripping is actually a pretty hard thing to do, might need to add another configuration option for something like this.

AlexRiedler avatar Feb 22 '15 18:02 AlexRiedler

I don't know how other tools implement it. I think they may rather just have you specify different folders for normal templates and partials. Not sure how that would integrate with the sprockets asset pipeline though.

andreasheim avatar Feb 25 '15 19:02 andreasheim