-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination doesnt work on a collection page #84
Comments
I'm currently facing the same issue, even though I've added
to the front matter of all my collection pages, the paginator won't pick it up. Just to clarify, my site structure is as follows:
In my
But how do I get pagination to work? None of the solutions or examples seem to work. I'm getting slightly confused as this doesn't seem like a unusual use-case. |
Hi, could you please provide me with a repro of this issue in a git repo somewhere or a zip file that I can test out. This may be a configuration that I hadn't anticipated and it is impossible to figure out why this is going wrong without being able to debug the exact issue :) |
I just created a new project to show my configuration: https://github.com/woutrbe/jekyll-pagination But a few questions:
Let me know if the example is clear enough. |
@renshuki I don't think so. How? |
I'm having the same issue. The collection I'm trying to paginate is called I don't see the Here's my setup, all relative to a top-level directory:
collections:
microblog:
output: true
exclude: ['Gemfile', 'Gemfile.lock']
kramdown:
entity_output: numeric
sass:
style: compressed
sass_dir: _sass
plugins:
- jekyll-paginate-v2
---
layout: default
title: Microblog
pagination:
enabled: true
collection: microblog
---
<br />
<h1>Microblog</h1>
{% for post in paginator.posts %}
<h1>{{ post.content }}</h1>
{% endfor %}
{% if paginator.total_pages > 1 %}
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a>
{% else %}
<span>« Prev</span>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<em>{{ page }}</em>
{% elsif page == 1 %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
{% else %}
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next »</a>
{% else %}
<span>Next »</span>
{% endif %}
</div>
{% endif %}
<!-- Unrelated content follows --> I hope that's a clear example that demonstrates the issue, but I'm happy to clarify anything if needed. Edit: Had stuff left over from an autopaging experiment in my _config.yml that I didn't mean to paste here, I've removed it from the example code. |
Figured it out. Based on my example above, my existing Other resources not mentioned in my example above that used to be in tl;dr posts need to be inside |
@joshdick you might also need to add a string filter to remove /index.html if your _config.yml is set to expressionless urls (pretty)- which paginate v2 does not seem to honour.
|
@spero-cnet That indeed happened to me and your code did the trick, thanks for the tip. |
Thank you thank you. I was having the same issue and searching all over this repo was not helping. Your comment was the only thing that cleared it up (well, your comment and taking a lunch break before deep frustration set in :) ) |
@vcavallo You're welcome! |
Thanks.. was stumbling upon this as well.. it did seem from #104 that it could be fixed in other ways, but couldnt get that to work |
I want to use some of my collection pages to show pagination of other collections. but it seems this plugin doesnt support this functionality. Any reason why? and any chance it could be considered as a feature request?
The text was updated successfully, but these errors were encountered: