panini icon indicating copy to clipboard operation
panini copied to clipboard

Support subfolders in layouts the same way they are supported in partials

Open lipis opened this issue 7 years ago • 4 comments

for v2.0

lipis avatar Jan 29 '18 19:01 lipis

@gakimball Any chance we can get that any time soon? (in the v2 branch?)

lipis avatar Feb 06 '18 15:02 lipis

I can probably get to it in the next few days. With the spare time I have I've been working on #143, which refactors how all the template/partial/helper loading works.

If you'd like to implement it before then, I'd take a PR.

gakimball avatar Feb 06 '18 17:02 gakimball

Thanks @gakimball no much spare time these days.. can you point out the similar PR for the partials.. just to get an idea?

lipis avatar Feb 06 '18 18:02 lipis

Here's where it happens for partials: https://github.com/zurb/panini/blob/8d5a66701f299c5040b41e24165324f02ed94c11/engines/handlebars.js#L49

You can see that the name is a calculated path based on the project root. Whereas, if you go up a few lines, where layouts are created, it just takes the basename, which means it's always just the name of the folder. Basically you're gonna copy the path calculation code from partials over to layouts.

gakimball avatar Feb 06 '18 18:02 gakimball