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?
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 %}
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.
This is one of those scenarios where I came back to it, seemingly tried the exact same thing, and it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With