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

No paginator in get_section() #2473

Open
charlesrocket opened this issue Apr 13, 2024 · 5 comments
Open

No paginator in get_section() #2473

charlesrocket opened this issue Apr 13, 2024 · 5 comments

Comments

@charlesrocket
Copy link
Contributor

charlesrocket commented Apr 13, 2024

There is no way to get paginator's page (page/13, etc) permalink due to standalone variable (#691).

Trying to work around this but get_url() refuses to error:

{% set foo = get_url(path="/posts/page/10142342340101263162411010112") %}

foo should fail in this case since the test site has only 10 posts with the section's pagination set to 2.

@Keats
Copy link
Collaborator

Keats commented Apr 17, 2024

get_url doesn't check whether the path exists as some stuff gets added during the build process.

@charlesrocket
Copy link
Contributor Author

@Keats oh snap, that was my last idea. There are still sitemaps, but I have a grim feeling. All the work on the dynamic PWA cache just got cancelled because there's nowhere to pull pager permalinks from.

@Keats
Copy link
Collaborator

Keats commented Apr 19, 2024

Once we have tera2 it should be possible to revamp all the functions to get the paginator but it's far away

@charlesrocket
Copy link
Contributor Author

@Keats what about something like validate_permalink() since Tera 2 is not happening any time soon?

@charlesrocket
Copy link
Contributor Author

While there is no built-in solution, one could manually extract pagination settings and calculate required page numbers: charlesrocket/halve-z/pull/27

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

No branches or pull requests

2 participants