Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: direct link to some paginated page #11

item4 opened this issue Dec 21, 2015 · 2 comments

request: direct link to some paginated page #11

item4 opened this issue Dec 21, 2015 · 2 comments


Copy link

item4 commented Dec 21, 2015

for example

<a href="{{ this.pagination.url_to(1) }}">First Page</a><!-- /blog/page/1/ -->
<a href="{{ this.pagination.url_to(-1) }}">Last Page</a> <!-- /blog/page/20/ -->
<a href="{{ this.pagination.url_to(999999999999) }}">Non-existed Page - raise error</a>
<a href="{{ this.pagination.url_to('a') }}">wrong type - raise error</a>

more complexly

<a href="{{ site.query('/another_paginated_page').pagination.url_to(10) }}">/another_paginated_page/page/2/</a>
<!-- not good example. -->
Copy link

Indeed. That's lacking. Though for consistency with prev and next it should probably be something other than url_to.

JFTR. The current pattern is this:

<a href="{{ this.pagination.prev|url }}">...</a>

Basically this returns the previous (or next for next) pagination controller.

So maybe this is needed:

<a href="{{ this.pagination.get(2)|url }}">...</a>

Also needs a better name. I wish this could just be .page but page is the number of the current page. Suggestions?

@mitsuhiko mitsuhiko added this to the 2.0 milestone Dec 21, 2015
Copy link

Maybe this would work?

<a href="{{ this.pagination.for_page(2)|url }}">...</a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants