Jekyll博客系统更换主题失败的问题

错误日志:

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,这几个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主题的layouts中,也就是'minima-2.1.1/_layouts'路径中有'default.html','home.html','page.html','post.html'几个文件,而在我们新设置的主题midnight中却只有'default.html'一个文件,至此我们就清楚地理解了这个问题。

难道我们去修改对应主题的gem文件吗?这样可行但不合理。我们可以在博客站点根目录新建文件夹命名为"_layouts",把缺失的那几个html文件从minima主题中拷贝到这个文件夹即可。当然这只是我个人的做法,供参考。

你可能感兴趣的:(Jekyll博客系统更换主题失败的问题)