Reputation: 425
My plan is to have folders within the _includes
directory:
_includes/footers
_includes/heros
_includes/cta
etc...
When I reference that {% include footers/footer1.html %}
I get the following error:
Liquid Exception: Included file '_includes/footers/footer1.html' not found in _layouts/default.html
Is this outside the intended functionality, or am I missing something?
Upvotes: 8
Views: 3289
Reputation: 221
Yes you can nest partials. Subdirectories don't have to be prepended with an underscore.
Let's say you have a footers
folder inside the _includes
folder.
_includes/footers
You could include your resources by adding the relative path:
{% include footers/footer1.html %}
Upvotes: 12
Reputation: 1668
On jekyll 3.0.1
you don't have to use _
to prepend directories in _includes
.
I have a structure like _includes/foo/file.html, _includes/bar/file.html
and I use it like {% include foo/file.html %}
and {% include bar/file.html %}
. It works perfectly fine without underscores. This might be a behavior that is not present in other versions of Jekyll.
Upvotes: 2
Reputation: 425
This is one of those scenarios where I came back to it, seemingly tried the exact same thing, and it worked.
Upvotes: 1