amatsuda/kaminari — pull request #599 by joe1chen (2014-09-04 17:49:58+00:00)
Title: Fixes for out of range next/prev links and tags

Add additional checks to not generate next and prev links as well as rel next/prev tags if the current page is greater than the last page. If the current page is one page after the last page, then we still generate the prev link/tag.

Added specs for next and prev links as well as the rel next/prev tags in the head.

We were seeing that on a particular page, we might only have 3 pages, but for some reason GoogleBot was coming along and indexing /page/100, /page/101, etc. This might seem harmless at first, but what ends up happening is that when the index is out of range, then GoogleBot gets stuck infinitely traversing the next links.

This bug fix should stop bots from infinitely crawling your website when the page is out of range.