杰基尔的帖子没有生成

aro*_*tav 93 jekyll

我正在尝试向我的Jekyll网站添加一个新帖子,但是当我运行时,我无法在生成的页面上看到它jekyll serve.

没有生成Jekyll帖子的常见原因是什么?

aro*_*tav 209

  • 未来是现在 (4认同)
  • 在 `_config,yml` 中使用 `future:true` 且在 `:` 之后没有任何空格会导致错误:配置文件:(无效)。大多数情况下会使用“future: true”来代替。 (3认同)

fan*_*ing 17

您可以使用jekyll build --verbose详细查看构建过程.

产量输出:

  Logging at level: debug
Configuration file: /home/fangxing/fffx.github.io/_config.yml
  Logging at level: debug
         Requiring: jekyll-archives
         Requiring: jekyll-livereload
         Requiring: kramdown
            Source: /home/fangxing/fffx.github.io
       Destination: /home/fangxing/fffx.github.io/_site
 Incremental build: enabled
      Generating... 
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /Gemfile.lock
           Reading: _posts/2018-01-14-new-post.md
           Reading: _posts/2014-01-01-example-content.md
           Reading: _posts/2014-01-02-introducing-lanyon.md
           Reading: _posts/2017-11-21-welcome-to-jekyll.markdown
           Reading: _posts/2018-01-14-boot-android-on-charge.md
           Reading: _posts/2013-12-31-whats-jekyll.md
          Skipping: _posts/2018-01-14-boot-android-on-charge.md has a future date
        Generating: Jekyll::Archives::Archives finished in 0.000122873 seconds.
        Generating: JekyllFeed::Generator finished in 0.000468846 seconds.
        ...
Run Code Online (Sandbox Code Playgroud)

从日志我发现jeklly跳过2018-01-14-boot-android-on-charge.md因为它有一个未来的日期.


sta*_*fry 7

一个可能的原因是date前面内容中指定的不包含时区偏移量,在这种情况下,它默认为 UTC,而不是您可能期望的本地机器的时区。我在这上面浪费了一个小时,直到 UTC “赶上”我当前的本地时区 BST。

我还没有找到明确的答案,但我认为前面的日期必须在 UTC 中给出,并带有时区偏移量(如果省略,则默认为零)。

因此,date: 2018-05-03 12:34:27 在UTC无论你是在世界上的,而不管的timezone中设置_config.yml

所以要小心地指定这样的日期时间:

date: 2018-05-03 12:34:27 +0100
Run Code Online (Sandbox Code Playgroud)