2017-07-16 58 views
-1

嗯,我發誓我沒有改變任何設置。傑基爾Github突然不工作,因爲'無'日期

我設置了我的Jekyll博客,之前它確實工作。

每次我想寫一些新的東西時,我只需複製舊的後期文件,將其重命名爲當前日期並修改其中的內容。

但僅僅一天後,我把我的新內容,Github上,我收到一封電子郵件,注意到我,

The page build failed for the master branch with the following error:
The value 'nil' was passed to a date-related filter that expects valid dates in /_layouts/post.html or one of its layouts. For more information, see https://help.github.com/articles/page-build-failed-date-is-not-a-valid-datetime/ .
For information on troubleshooting Jekyll see:
https://help.github.com/articles/troubleshooting-jekyll-builds

首先,我沒有修改/_layouts/post.html。其次,我沒有在YAML中使用日期信息,因爲Jekyll已經使用了像YY-MM-DD-title.md這樣的強名稱要求。

我只是一些想寫點樂子但對IT技術知之甚少的人。我找遍了哲基爾文檔,並閱讀StackOverflow上的帖子象下面這樣:

Invalid date while building on Github Pages

但正如我post.html文件內容是從文章不同,我不知道我能做些什麼。

我建立它在我的Mac上bundle exec Jekyll build,它只是顯示了相同的信息電子郵件

$ bundle exec jekyll build Configuration file: > /Users/zhanglidong/Documents/ASyncFiles/jetorz.github.io/_config.yml Source: /Users/zhanglidong/Documents/ASyncFiles/jetorz.github.io Destination: > /Users/zhanglidong/Documents/ASyncFiles/jetorz.github.io/_site Incremental build: disabled. Enable with --incremental
Generating...
Liquid Exception: Invalid Date: 'nil' is not a valid datetime. in /_layouts/post.html
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
Invalid Date: 'nil' is not a valid datetime.

我的GitHub庫:https://github.com/jetorz/jetorz.github.io

我的化身博客:https://jetorz.github.io/

我怎麼能修理它?任何人想幫助我可憐嗎? :(

回答

0

答案一樣上面建議,

我重新檢查我提供的鏈接:在<time>部分外

Invalid date while building on Github Pages

有和if

我不知道很多關於液體,

但我覺得值得一試

所以我添加此ifpost.html像下面

{% if page.date %} 
     <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished"> 
      {% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %} 
      {{ page.date | date: date_format }} 
     </time> 
{% endif %} 

我不知道到底是什麼一回事,

,但它的工作:)

現在我又可以張貼我的博客。