github 博客报错解决

今天提交文章到 GitHub 博客中,却总是出现

The file vendor/cache/ruby/2.5.0/gems/jekyll-3.6.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb does not have a valid date in the YAML front matter. 的错误

错误具体信息如下:

The page build failed for the master branch with the following error:

The file vendor/cache/ruby/2.5.0/gems/jekyll-3.6.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb does not have a valid date in the YAML front matter. For more information, see

https://help.github.com/articles/page-build-failed-invalid-post-date/.

For information on troubleshooting Jekyll see:

https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

jekyll 的 Issues 中,找到了解决方式

exclude: [vendor] 添加到 _config.yml 文件中即可。

原因如下:

Jekyll has a copy of itself in the vendor directory there. It includes our tests. We have that post in our tests to ensure we fail on invalid dates.