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

Closed
item4 opened this issue Dec 21, 2015 · 2 comments
Closed

request: direct link to some paginated page #11

item4 opened this issue Dec 21, 2015 · 2 comments
Labels
Milestone

Comments

@item4
Copy link
Contributor

@item4 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. -->
@mitsuhiko

This comment has been minimized.

Copy link
Member

@mitsuhiko mitsuhiko commented Dec 21, 2015

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
@mitsuhiko

This comment has been minimized.

Copy link
Member

@mitsuhiko mitsuhiko commented Dec 21, 2015

Maybe this would work?

<a href="{{ this.pagination.for_page(2)|url }}">...</a>
@mitsuhiko mitsuhiko closed this in d8a1908 Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.