Open charlesrocket opened 5 months ago
get_url
doesn't check whether the path exists as some stuff gets added during the build process.
@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.
Once we have tera2 it should be possible to revamp all the functions to get the paginator but it's far away
@Keats what about something like validate_permalink()
since Tera 2 is not happening any time soon?
While there is no built-in solution, one could manually extract pagination settings and calculate required page numbers: charlesrocket/halve-z/pull/27
Hello,
In order to set up a 'series' feature in a theme, I would need to know if pagination is reversed or not so that I can align series' pages indexes accordingly.
Everything works well in the series itself (which is a section) has I have both section
and paginator
variables.
Nevertheless, in the series' pages, I can just do a get_section
to retrieve the series' section information and I don't have any way to retrieve pagination information.
Unfortunately, applying the workaround just above would not work in my case because my series' section has some content (and not only frontmatter).
Reversing the order of the pages listed in the section when paginate_reversed
(or maybe something more meaningful such as sort_reversed
) is set to true
would work as well for me but I would expect it to have such a huge impact that it doesn't worth it in my opinion.
Even if adding the entire paginator seems not possible, do you think it would be possible to just add paginate_by
and paginate_reversed
in the serialized section returned by get_section
?
https://github.com/getzola/zola/blob/051becaa1c681165c9f32d30e4e4bde3952765bc/components/content/src/ser.rs#L206-L229
If yes, I can try to tackle it and propose a PR in the weeks to come. If you would prefer me to open a new issue instead of reusing this one, please tell me.
Thanks for your help and support.
Even if adding the entire paginator seems not possible, do you think it would be possible to just add paginate_by and paginate_reversed in the serialized section returned by get_section
That would be fine yes
That would be fine yes
Thanks for your feedback.
This is my first contribution and I was not able to figure out which branch I should push this modification to (master
or next
).
Is master
dedicated to bug fixing the current version only or should we consider this small evolution to be part of it as well?
Thanks in advance for your help and support.
master
is only for docs update, all new features/bug fixes go on the next
branch
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:foo
should fail in this case since the test site has only 10 posts with the section's pagination set to2
.