sverrirs / jekyll-paginate-v2

Pagination Generator for Jekyll 3 (enhanced replacement for the old built-in jekyll-paginate gem) ⛺
https://rubygems.org/gems/jekyll-paginate-v2
MIT License
521 stars 288 forks source link

next/previous button in post page #231

Open bolun365 opened 2 years ago

bolun365 commented 2 years ago

I list articles in a page like this:

{% if paginator %}
  {% assign posts = paginator.posts %}
{% else %}
  {% assign posts = site.posts %}
{% endif %}
{% assign entries_layout = page.entries_layout | default: 'list' %}
<div class="entries-{{ entries_layout }}">
  {% for post in posts %}
    {% include archive-single.html type=entries_layout %}
  {% endfor %}
</div>

But in the post page, the next previous article button and next article button still use the variable page.previous.url and page.next.url. The variable paginator can't be readed in post page.