Jekyll博客文章未在GitHub Pages上显示

3

我使用Jekyll构建了我的网站,在本地运行时其功能良好。但是,当我将我的网站部署到github pages时,博客文章不再显示。

我咨询了一个之前的问题:Jekyll post not generated,但它没有解决我的问题。

当我在本地执行bundle exec jekyll serve时,会获得以下消息:

 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
         AutoPages: Disabled/Not configured in site.config.
        Pagination: Complete, processed 1 pagination page(s)
                    done in 6.303 seconds.

这表明一切正常工作。问题出在哪里?

1个回答

2

如果一切正常,您将收到一条消息,提示您的服务器正在正常运行。

例如,这是我的信息(请注意最后一行):

$ bundle exec jekyll serve
Configuration file: /Users/alexfreik/Documents/GitHub/ltc-webpage/_config.yml
            Source: /Users/alexfreik/Documents/GitHub/ltc-webpage
       Destination: /Users/alexfreik/Documents/GitHub/ltc-webpage/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.94 seconds.
 Auto-regeneration: enabled for '/Users/alexfreik/Documents/GitHub/ltc-webpage'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

您有这些信息吗?

编辑:问题在于分页设置不正确。


是的,我的信息看起来与你的相似。当我在本地运行jekyll时一切都正常。但是当我部署到github页面时,博客文章会消失。 - Magi
你可以在 Gemfile 中的 group :jekyll_plugins 中添加 gem "github-pages" 吗? - AlexFreik
1
确实。看起来你的分页有些问题。当我将for post in paginator.posts替换为for post in site.posts(并在我的GitHub repo-clone中测试了你的网站)时,这篇文章已经出现在GitHub页面上了。 - AlexFreik
1
摆脱固定链接并将paginator.posts更改为site.posts实际上解决了问题。非常感谢! - Magi
没问题,哈哈),但是看起来你想要这个分页功能,所以你仍然需要调试一下)。 - AlexFreik
显示剩余4条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接