include - 在 Jekyll 中,include_relative 是如何处理布局文件的?

标签 include jekyll relative-path

我有一个名为 default.html 的文件在我的 layouts文件夹。在 default.html ,我想加一个亲戚includetest.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/

相关文章:

ruby-on-rails - jekyll ruby​​ 上的 kramdown coderay syntax_highlighter

ruby - 我无法在我的 github 博客上更改 jekyll 语法荧光笔

php - 为什么应该在相关链接(Codeigniter 等)中使用 base_url()

c# - 从 URI 相对路径中删除 %20

c# - 从单独的源文件 (ASP.NET/C#) 插入代码

VB.Net:在多个文件中包含通用代码

c - 需要一些关于 C header 包含的建议

css - 如何为 Jekyll 添加自动前缀

python - 为什么相对路径在 python 测试中不起作用?

android - 如何让 RelativeLayout 与合并和包含一起使用?