0

我正在尝试在 index.html 上添加明信片分页,而它仅适用于本地主机。谁能帮我找出问题出在哪里?
这是我的post.html:

<section id="posts" class="container py-3 hide-on-search">
  <div class="row">
    <div class="col">
      <h1 class="pl-3 mb-3">Recent Posts</h1>
      <ul class="list-group list-group-flush px-xs-1 px-md-5 mb-3">
        {% for post in paginator.posts %}
        <li class="list-group-item">
          <p class="mb-0 text-muted">{{ post.date | date: "%b %-d, %Y" }}</p>
          <a class="lead" href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
          <p class="mb-0">
            {% if post.description %} {{ post.description }} {% else %} {{ post.excerpt | strip_html | strip_newlines | escape }} {% endif %}
          </p>
        </li>
        {% endfor %}
      </ul>

    </div>
  </div>
</section>

我正在使用 jekyll-paginate,看来这条线{% for post in paginator.posts %}不起作用。

这是我的本地主机页面: 在此处输入图像描述

这是我的 GitHub 页面(未显示明信片): 在此处输入图像描述

这是我的仓库:https
://github.com/Colawithrain/Colin_Blog 这是我的 github 页面:https : //colawithrain.github.io/Colin_Blog/

干杯,

科林

4

1 回答 1

0

我在你的博客文件中找到了这句话。README.md

我还没有弄清楚是否/如何在 Github Pages 上进行这项工作。

我认为您可能会被Github Pages 的一组白名单插件阻止。在你的本地机器上没有这样的限制。

在这种情况下,我认为如果您检查这个,您可能会找到一些解决方案。(我不是 100% 确定...)

于 2021-05-05T03:25:20.763 回答