在Jekyll中,include_relative对于布局文件如何工作? [英] In Jekyll, how does include_relative work with respect to layout files?
问题描述
我的layouts
文件夹中有一个名为default.html
的文件.在default.html
中,我想向test.html
添加相对的include
,这也位于我的布局文件夹中.
I have a file called default.html
in my layouts
folder. In default.html
, I want to add a relative include
to test.html
, which is also in my layouts folder.
我将{% include_relative test.html }%
添加到我的default.html
文件中以包含test.html
.但是,执行此操作时,出现错误消息
I add {% include_relative test.html }%
in my default.html
file to include test.html
. However, when I do this, I get an error that says
"Liquid Exception: Included file './test.html' not found in
projects/[projectnmae]/layouts/default.html"
我的layouts
文件夹确实位于我的配置文件中指定的其他位置.如果include_relative
以某种我不了解的特殊方式起作用,有什么想法吗?
I do have my layouts
folder in a different location, as specified in my configuration file. Any ideas if include_relative
works in a special way here that I'm not grasping?
推荐答案
您不能对布局文件夹内的任何文件使用include_relative
标记.您只能在页面或帖子上使用include_relative
.
You can't use the include_relative
tag with any files inside your layouts folder. You can only use include_relative
on a page or post.
这篇关于在Jekyll中,include_relative对于布局文件如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!