Allow sort filter to be case insensitive
I saw it was proper ages ago that someone tried bringing case sensitivity to the sort filter and figured I'd go at it. If I'm not mistaken, Tera will use case sensitivity by default (that is, prior to and after this PR) so I only added a test for case insensitivity.
Closes #587 Closes #831 See also : #693
Thank you so much for writing this patch—I've been looking for this functionality for ages but haven't had the time to implement something myself!
Hope this gets merged soon.
Wanted to throw in a wee screenshot too of it behaving as expected, as well :
Before
@keats Just wanted to follow up to see what your ideas for resolving the MSRV test failing so that we can get this merged and brought upstream to Zola ^_^
I think it's fine to merge as is and change the MSRV after merge. By the way I haven't implemented the sort filter yet in tera2 (https://github.com/Keats/tera2) if someone is interesting in porting it.
By the way I haven't implemented the sort filter yet in tera2 (https://github.com/Keats/tera2) if someone is interesting in porting it.
I might have some time to work on it this month — are there any quirks or other things I might need to know about with the new version ?
It should be easier to implement, they look more like regular functions. For example: https://github.com/Keats/tera2/blob/master/tera/src/filters.rs#L322-L341
It should be easier to implement, they look more like regular functions. For example: https://github.com/Keats/tera2/blob/master/tera/src/filters.rs#L322-L341
Since the round topic has been touched upon, I will make my suggestions regarding this filter. It would be logical to add the trunc method.
...
Some("trunc") => Ok(((multiplier * val).trunc() / multiplier).into()),
...
Sure that can be added
For whatever reason, GitHub never notified me of this — I've got no problem adding it in if it hasn't already been done so upstream by @Keats or someone else
Go for it