johno / pixyll

A simple, beautiful Jekyll theme that's mobile first
http://pixyll.com
MIT License
2.05k stars 1.34k forks source link

Pixyll Pagination.html broken? #440

Closed caprinux closed 3 years ago

caprinux commented 3 years ago

I'm currently using Pixyll theme which runs Jekyll. After writing my 5th post today, I realize 2 issues. Firstly, my homepage starts from older posts rather than newer posts. How do I reverse the pagination?

Secondly, I am unable to navigate through the pages. The newer and older button merely sends me back to my home page.

I am totally lost, please help me out; this is my currently dysfunctional website and my repo is here

This is my current config.yml

# Pagination
paginate:           4
paginate_path:      /page:num/
sass:
  style: compressed
plugins:
  - jekyll-paginate
  - jekyll-sitemap

This is my pagination.html

{% if paginator.total_pages != 1 %}
<div class="pagination clearfix mb1 mt4">
  <div class="left">
    {% if paginator.previous_page %}
      {% if paginator.page == 2 %}
        <a class="pagination-item" href="{{ "/" | relative_url }}">{{ site.text.pagination.newer | default: "Newer" }}</a>
      {% else %}
        <a class="pagination-item" href="{{ paginator.previous_page_path | relative_url }}">{{ site.text.pagination.newer | default: "Older" }}</a>
      {% endif %}
    {% else %}
      <span class="pagination-item disabled">{{ site.text.pagination.newer | default: "Newer" }}</span>
    {% endif %}
  </div>
  <div class="right">
    {% if paginator.next_page %}
      <a class="pagination-item" href="{{ paginator.next_page_path | relative_url }}">{{ site.text.pagination.older | default: "Older" }}</a>
    {% else %}
      <span class="pagination-item disabled">{{ site.text.pagination.older | default: "Older" }}</span>
    {% endif %}
  </div>
  <div class="pagination-meta">Page {{ paginator.page }} of {{ paginator.total_pages }}</div>
</div>
{% endif %}