Implementing a "sorted by" button/pulldown for ranges of pages?

Hi folks,

I’d like to be able to allow users to select whether or not they see blog pages sorted by the default method, -or- optionally to sort them alphabetically. I know how to use {{range .Pages.<attribute>}} to do so, but what I’m really looking for is an example of the best practices for allowing a user to sort on the fly.

The best I have right now is to have two totally separate pages (implemented through partials) where one uses {{ range .Pages }} and the other uses {{ range .Pages.ByTitle }} but I was hoping someone might have come up with something cute that either didn’t involve refreshing the page, or creating the output twice and hiding it using display:none; on the same page. Thoughts?

It doesn’t have to be fast, but should “look reasonably nice” which is difficult without a bunch of javascript.