Paginator is not working on github pages, but it works on localhost

100 views Asked by At

I am trying to add postcards pagination on index.html, while it only works on the localhost. Can anybody help me figure out where the problem is?
Here is my 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>

I am using jekyll-paginate, it seems the line {% for post in paginator.posts %} is not working.

Here is my localhost page: enter image description here

and here is my GitHub pages page (postcards are not presented): enter image description here

Here is my repo:https://github.com/Colawithrain/Colin_Blog
Here is my github page: https://colawithrain.github.io/Colin_Blog/\

Cheers,

Colin

1

There are 1 answers

0
hong On

I found this sentence in your blog's README.md file.

I haven't worked out if/how to make this work on Github Pages.

I think you might be blocked by a set of whitelisted plugins of Github Pages. There is no limit like this in your local machine.

In that case, I think you may find some solution if you check this. ( I am not 100% sure...)