爱收集资源网

错误日志:编译时不能找到'post'home对应的Layout

网络整理 2022-04-14 07:00

错误日志:

Build Warning: Layout 'post' requested in _posts/2017-10-16-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'post' requested in _posts/2017-10-17-2.markdown does not exist.
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
Build Warning: Layout 'page' requested in about.md does not exist.
Build Warning: Layout 'home' requested in index.md does not exist.

编译时找不到'post'、'page'、'home'对应的Layout。这些布局在哪里?运行命令即可查看

# On MacOS
open $(bundle show minima)
# On Windows
explorer /usr/local/lib/ruby/gems/2.3.0/gems/minima-2.1.0

这里的'minima'指的是你要查看的gem(主题也是gem),我们可以在minima主题的布局中看到,即'minima-2.1.1/_layouts '路径中有'default.html', 'home.html', 'page.html', 'post.html' 几个文件博客换主题有必要吗,但是我们的里面只有一个文件'default.html'新设置的主题午夜,到目前为止我们已经清楚地了解了问题。

要不要修改主题对应的gem文件?这有效但不合理。我们可以在博客站点的根目录下新建一个名为“_layouts”的文件夹,并将minima主题中缺少的html文件复制到这个文件夹中。当然博客换主题有必要吗,这只是我个人的做法,供参考。

主题 对应 日志