New Liquid tag for listing files (useful for image galleries, download lists, and index pages).

Here's a basic usage:

     {% gallery name:your_gallery_name %}
     <img src="{{ file.path }}" />
     {% endgallery %}

If you want to arrange the images into a grid, you can do this:

     <table><tr>
     {% gallery name:your_gallery_name %}
     <td><img src="{{ file.path }}" alt="{{ file.title }}"/>
     <p>Taken on {{ file.date | date: "%F" }}</p></td>
     {% cycle '', '', '', '</tr><tr>' %}
     {% endgallery %}
     </tr></table>

It provides this data to the templates:

    file.url        # absolute path to file
    file.path       # relative path to file
    file.htmlurl    # absolute path to html file
    file.htmlpath   # relative path to html file
    file.name       # File.basename(filename)
    file.date       # date extracted from beginning of filename, if present (optional)
    file.slug       # basename with the date and file extension stripped off
    file.title      # file.slug with hyphens converted to spaces, and put into Title Case

As well as the familiar `forloop` variable.

Also, none of my code is actually specific to image files. This plugin could easily be used to glob anything out of the filesystem, including a list of available downloads:

     <ul>
     {% gallery name:downloads_page dir:downloads format:tar.gz reverse:no %}
     <li><a href="{{ file.path }}">{{ file.title }}</a></li>
     {% endgallery %}
     </ul>

The above example assumes that it's located inside `/downloads_page/index.html` and that your `.tar.gz` files are in `/downloads_page/downloads/*.tar.gz`. Input is sanitized to prevent the user being able to glob outside of the jekyll source directory.

`gallery` also reads YAML Front Matter from globbed files, if present. So if you're trying to make an index page for other pages on your site (such as a site map), you can access the yaml in those files directly from the `file` attribute. In fact, the YAML is interpreted after the filename is parsed, meaning that you can override calculated title and other attributes from your YAML. For example:

    <ul>
    {% gallery dir:. format:textile reverse:no %}
    <li><a href="{{ file.htmlpath }}">{{ file.title }}</a> {{ file.description }}</li>
    {% endgallery %}
    </ul>

This example provides a list of links to all the .textile files in your sourcedir, linking correctly to the .html version of those files, and displays the `description` keyword defined in each file's YAML.