您可以使用Jekyll的_includes文件夹中的子目录吗? [英] Can you use subdirectories within Jekyll's _includes folder?

查看:150
本文介绍了您可以使用Jekyll的_includes文件夹中的子目录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的计划是在_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆