【问题标题】:Paginator is not working on github pages, but it works on localhostPaginator 不在 github 页面上工作,但它在 localhost 上工作
【发布时间】:2020-11-26 07:08:12
【问题描述】:

我正在尝试在 index.html 上添加明信片分页,而它仅适用于 localhost。谁能帮我找出问题出在哪里?
这是我的 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/\

干杯,

科林

【问题讨论】:

    标签: jekyll-paginator


    【解决方案1】:

    我在您博客的README.md 文件中找到了this sentence

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

    我想你可能会被a set of whitelisted plugins of Github Pages 屏蔽。在你的本地机器上没有这样的限制。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多