Hello, I’m using Jekyll v3.4.3 in Arch and I’ve been experiencing some issues with pagination on my homepage. When I add to _posts with the categories foo1 or foo2, the homepage paginates nicely. When I populate category foo3 with posts, the homepage doesn’t show any posts at all. It’s very bizarre and I don’t know where to start debugging.
Could it be an issue with my index?
$ cat /website/index.html
---
layout: default
---
<div class="home">
{% for post in paginator.posts %}
{% if post.categories contains "foo1" or post.categories contains "foo2" %}
<div class="post postContent">
<div class="postTag">
{{post.tag}}
</div>
<div class="postTitle">
<a class='postLink' href="http://website.com{{site.baseurl}}{{post.url}}">{{post.title}}</a>
</div>
<div class="postExt">
{{ post.content | strip_html | truncate:275}}
</div>
</div>
{% endif %}
{% endfor %}
{% if paginator.total_pages > 1 %}
<nav class="pagination">
{% if paginator.previous_page %}
<a class="paginationLink" href="http://website.com{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<em class="paginationLink paginationLinkCurrent">{{ page }}</em>
{% elsif page == 1 %}
<a class="paginationLink" href="/">{{ page }}</a>
{% else %}
<a class="paginationLink" href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}/">{{ page }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<a class="paginationLink" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}/">Next »</a>
{% endif %}
</nav>
{% endif %}
</div>
Or the default.html?
$ cat /website/_layouts/default.html
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
{% include header.html %}
<div class="page-content">
<div class="wrapper">
{{ content }}
</div>
</div>
{% include footer.html %}
</body>
</html>
Or something else? Could really use some help with this, I’m totally stuck. Let me know if you need anymore info.