Keats / tera

A template engine for Rust based on Jinja2/Django
http://keats.github.io/tera/
MIT License
3.5k stars 281 forks source link

Add a case_sensitive attribute to the sort filter #831

Open slatian opened 1 year ago

slatian commented 1 year ago

A feature request.

When sorting strings sometimes one doesn't care whether a letter is uppercase or lowercase just that the 'a's are near the 'A's.

The current behavior of sort is that it sorts (for Latin at least) Uppercase before lowercase:

When someone would implement this the resulting sort(case_sensitive=false) would sort as if the attribute to sort by was ran through a lowercase filter first:

If that is too complex for the current version of tera because of implementation details I'm not aware of please consider it for the v2 wishlist.

Note: the unique filter already has such a flag.