robotpony/chronicle.md — pull request #6 by ngallagher87 (2013-08-22 19:56:25+00:00)
Title: File sorting by date

## Problem

For my blog I was running a list of markdown files in a folder called `blog`:

/blog
| some_file.md
| another_file.md
| really_old_file.md

When adding new files, `chronicle` wasn't sorting the list in any particular order, which means that new files I'd want to be listed first on my page would be near the bottom.

## Sorting

This adds a way to sort how the lister returns files. By defining `sort: created` or `sort: modified` in `site.json`, that will define what method we sort files that are being returned. If this config line is not present, no sorting will be performed.

Although the sorting algorithm adds some performance hit, based on my tests it only adds `0.79` milliseconds (based on 11 tests).