I was easily able to find a way to sort my blog posts by most recently updated using sort:
{% for content in contents|sort(True, False, 'updatedDateTime') %}
However, it only sorts the posts in batches according to the pagination, I guess because of lazy loading? The first page is the 12 most recently published posts sorted by the update time, then the second page is the next 12 most recently published sorted by the update time, and so on. I tried setting a variable before the loop, as in
{% set sorted_contents = contents|sort(True, False, 'updatedDateTime') %}
and then pass sorted_contents into the for loop, but it didn't work.
Is there a way to sort the entire contents array outside of pagination/lazy loading? Thanks in advance.