ajmalafif
1/3/2018 - 6:42 PM

jekyll-paginate-v2 new paginator

jekyll-paginate-v2 new paginator


{% if paginator.total_pages > 1 %}
{{page.url}}<br>
{{page.path}}<br>

<ul class="pager">
    {% if paginator.first_page %}
    <li class="previous">
        <a href="{{ paginator.first_page_path | prepend: site.baseurl | replace: '//', '/' }}">First</a>
    </li>
    {% endif %}

    {% if paginator.previous_page %}
    <li class="previous">
        <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&larr; Newer Posts</a>
    </li>
    {% endif %}

    {% if paginator.page_trail %}
      {% for trail in paginator.page_trail %}
        <li {% if page.url == trail.path %}class="selected"{% endif %}>
            <a href="{{ trail.path | prepend: site.baseurl | replace: '//', '/' }}" title="{{trail.title}}">{{ trail.num }}</a>
        </li>
      {% endfor %}
    {% endif %}

    {% if paginator.next_page %}
    <li class="next">
        <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Older Posts &rarr;</a>
    </li>
    {% endif %}

     {% if paginator.last_page %}
    <li class="previous">
        <a href="{{ paginator.last_page_path | prepend: site.baseurl | replace: '//', '/' }}">Last</a>
    </li>
    {% endif %}
</ul>
{% endif %}