Support multiple Includes directories #4117
mrtnmgs
started this conversation in
Enhancement Queue
Replies: 4 comments
|
You could add |
0 replies
|
I'd also like to say that I think you already opened a ticket on the Discord forum for this issue! You'll will definitely get faster and better answers on there instead of here - most issues on this repo don't actively get responses. |
0 replies
|
Ok so from what I gather there's no 11ty way to do this... |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
I often need to break the content of a page into several files in order to separate code and content. (If the content can only be injected in one place in the template, in many case this separation is not possible). As far as I understand all partials must live in the _includes directory. But it's awkward to have part of the content in one place and another part elsewhere:
I tried creating the partials where the page lives:
When I do this, a page is created for each partial. Adding the partials to
.eleventyignoreis not a working solution as hot reloading doesn't work anymore. It seems like partials have to live in the_includesdirectory in order to be handled properly. I had the same issue whether I imported the partial file withincludeorrenderFile.The best I was able to come with is specifying a separate directory for the layouts in
.eleventy.jsand move the location of the includes directory closer to the content. But if I use partials in different locations on my site it will still be awkward.Maybe I'm thinking about this the wrong way? Is there another way to have different pieces of content injected in different places in a template?
Describe the solution you'd like
I think the simplest fix would be to allow several directories for includes:
All reactions