我正在与Jekyll一起练习从头开始构建一个小网站。不幸的是,以下命令返回错误:
rodolfocangiotti.github.io rodolfo$ bundle exec jekyll serve --incremental --host=0.0.0.0
以下是打印到stdout
的内容:
Configuration file: /Volumes/Data HD/Jekyll Folder/rodolfocangiotti.github.io/_config.yml
Source: /Volumes/Data HD/Jekyll Folder/rodolfocangiotti.github.io
Destination: /Volumes/Data HD/Jekyll Folder/rodolfocangiotti.github.io/_site
Incremental build: enabled
Generating...
Liquid Exception: Could not locate the included file 'bodyheader.html' in any of ["/Volumes/Data HD/Jekyll Folder/rodolfocangiotti.github.io/_includes", "/usr/local/lib/ruby/gems/2.4.0/gems/minima-2.1.1/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source. in /_layouts/default.html
jekyll 3.6.2 | Error: Could not locate the included file 'bodyheader.html' in any of ["/Volumes/Data HD/Jekyll Folder/rodolfocangiotti.github.io/_includes", "/usr/local/lib/ruby/gems/2.4.0/gems/minima-2.1.1/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source.
实际上,bodyheader.html
文件位于_include
文件夹中。有人能够解释为什么Jekyll无法找到该文件以及如何解决问题吗?
更新
bodyheader.html
文件包含在default.html
文件中,该文件位于_layouts
文件夹中。以下是该文件的内容:
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
{% include bodyheader.html %}
{{ content }}
</body>
</html>
答案 0 :(得分:2)
尝试将_include
文件夹重命名为_includes
。