RobinThrift / metalsmith-paginate

A simple plugin that uses metalsmith-collections to create a paginated collection
MIT License
13 stars 5 forks source link

Fixed issues about the last doc object has pagination.next doc object. #7

Open anatoo opened 9 years ago

anatoo commented 9 years ago

Hi @RobinThrift,

I wrote the following template code to use metalsmith-paginate plugin.

<!-- using eco template engine  -->
<% if @pagination.next: %>
  <a class="button" href="<%= @getPath(@pagination.next) %>">NEXT &gt;</a>
<% end %>

But this code does not work on last pagination page because last doc object has pagination.next property that refer self doc object. This patch fix last doc object that has pagination.next doc object.