I'm using Jekyll-Paginate-v2 and their Pagination Trails to create pagination for my blog. I have everything working but wanted to add some ellipses to indicate more pages. When you're on the first page, the last page should show at the end with ellipses in front, and after passing a certain number of pages, the first page should show with ellipses as well. If you get to the last page the ellipses should disappear.
Example:
< 1 2 3 4 5 6 7 8 8 10 ... 50 >
< 1... 5 6 7 8 9 10 ... 50>
Pagination w/ Trails
{% if paginator.total_pages > 1 %}
<div class="pagination">
{% if paginator.previous_page %}
<a href='{{ paginator.previous_page_path | prepend: site.baseurl }}' class='prev'>Previous</a>
{% endif %}
{% if paginator.page_trail %}
{% for trail in paginator.page_trail %}
<a href="{{ trail.path | prepend: site.baseurl | replace: '//', '/' | remove: "index.html" }}" class='{% if page.url == trail.path %}current{% endif %}'>{{ trail.num }}</a>
{% endfor %}
{% endif %}
{% if paginator.next_page %}
<a href='{{ paginator.next_page_path | prepend: site.baseurl }}' class='next'>Next</a>
{% endif %}
</div>
{% endif %}
