您可以使用Jekyll的_includes文件夹中的子目录吗? [英] Can you use subdirectories within Jekyll's _includes folder?
问题描述
我的计划是在_includes
目录中包含文件夹:
My plan is to have folders within the _includes
directory:
_includes/footers
_includes/footers
_includes/heros
_includes/heros
_includes/cta
_includes/cta
等...
当我引用{% include footers/footer1.html %}
时,出现以下错误:
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.
假设您在_includes
文件夹中有一个footers
文件夹.
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 %}
这篇关于您可以使用Jekyll的_includes文件夹中的子目录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!