【问题标题】:Jekyll blog posts not showing up on github pagesJekyll 博客文章未显示在 github 页面上
【发布时间】:2022-01-19 04:29:28
【问题描述】:

我使用 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.

这似乎表明一切正常。有什么问题?

【问题讨论】:

    标签: html jekyll github-pages


    【解决方案1】:

    如果一切正常,您将收到一条消息,其中包含您的服务器正在运行 afaik 的信息。

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

    $ 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 页面时,博客文章消失了。
    • 您可以在group :jekyll_plugins 中的Gemfile 中添加gem "github-pages" 吗?
    • 我按照你的建议做了。但是博客文章仍然没有出现在我的页面上,你可以在这里看到jialun-zhang.github.io/blog
    • 我怀疑这个生成博客页面的 index.html 有问题。你能看看吗? github.com/jialun-zhang/jialun-zhang.github.io/blob/gh-pages/…
    • 确实如此。看来你的分页有问题。当我将 for post in paginator.posts 替换为 for post in site.posts(并在我的 GitHub repo-clone 您的网站中进行测试)时,该帖子已出现在 GitHub 页面上
    猜你喜欢
    • 2019-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-12
    • 1970-01-01
    • 2014-10-11
    • 2016-08-29
    相关资源
    最近更新 更多