-
Notifications
You must be signed in to change notification settings - Fork 905
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
Template filters first
/last
counterintuitive
#54
Comments
Those are built-in Changing the meaning of |
Would it? I think the array is ordered newest-first, so it would return the latest.
Maybe we could order the pages array ascending (by date/order). Then |
Yes sorry.
I'm not sure it makes sense tbh. |
Yeah, maybe you're right. It would be great if the |
The
last
filter of the tera template engine returns the last element of an array. This leads to counterintuitive results when used on an array of pages, sincepages|last
returns the last page in thepages
array, which is actually the first/earliest page (i.e. the page with the lowestordering
). So if one follows thenext
pointers of a page, one reachespages|first
instead of the expectedpages|last
.The text was updated successfully, but these errors were encountered: