locomotivecms/engine — pull request #421 by mobyjames (2012-05-25 16:38:06+00:00)
Title: Pagination sort

We added a sort feature for the 'pagination' tag based on the sort feature present in the main shopify/liquid repo for 'for' tags.

The logic is more-or-less identical to the aforementioned sort feature, with the addition of allowing options for pagination tags in the initialization. The syntax for adding options was borrowed directly from other tags in the locomotive/engine repo that allow options.

The syntax is fairly straight-forward and also listed as part of the comments in paginate.rb.

Example:

{% paginate post.tags sort_by name order: descending %}
{{ tag.name }}
{% endfor %}

We believe this feature adds little complexity while creating much more flexibility for users hoping to do custom sorting.