我有一个名为 default.html
的文件在我的 layouts
文件夹。在 default.html
,我想加一个亲戚include
至 test.html
,这也在我的布局文件夹中。
我加{% include_relative test.html }%
在我的 default.html
要包含的文件 test.html
.但是,当我这样做时,我收到一个错误消息
"Liquid Exception: Included file './test.html' not found in
projects/[projectnmae]/layouts/default.html"
我有我的
layouts
文件夹位于不同位置,如我的配置文件中所指定。任何想法,如果 include_relative
在这里以一种我不理解的特殊方式工作?
最佳答案
您不能使用 include_relative
用 layouts 文件夹中的任何文件标记。您只能使用 include_relative
在页面或帖子上。
关于include - 在 Jekyll 中,include_relative 是如何处理布局文件的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28617211/