rewdy / Pico-Pagination

Provides basic pagination for Pico.
27 stars 12 forks source link

URL to first page is incorrect #12

Closed joshas closed 7 years ago

joshas commented 7 years ago

I set up navigation on my index page. Its URL is http://eg.my.site/index , but pagination plugin creates a new URL for it http://eg.my.site/page/1 . As a result I have two URLs linking to same page. Any ideas how to fix it?

rewdy commented 7 years ago

The pagination plugin has a _pagination_pageindicator option that can be configured in your site's config.php file. You can try setting that to something else in order to get it to be what you want. Inevitably, there has to be some sort of indicator so that pico knows when there are pages. I guess that may end up creating duplicate URLs in some scenarios. I'm not sure how to avoid that exactly.

joshas commented 7 years ago

I think there should be a special case when formatting "previous" link to first page: do not use default /page/{page-num} format, but try to work out the url for first page with pagination. If no additional configuration options were set, it probably will be "index", otherwise - use page indicator.