在Jekyll中,include_relative对于布局文件如何工作? [英] In Jekyll, how does include_relative work with respect to layout files?

查看:112
本文介绍了在Jekyll中,include_relative对于布局文件如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的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屋!

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