imathis/octopress — pull request #649 by sillylogger (2012-07-01 05:27:02+00:00)
Title: Directory tag

The directory tag lets you iterate over files at a particular path. If files conform to the standard Jekyll format, YYYY-MM-DD-file-title, then those attributes will be populated on the yielded file object. The `forloop` object maintains [its usual context](http://wiki.shopify.com/UsingLiquid#For_loops).

#### Syntax

```liquid
{% directory path: path/from/source [reverse] [exclude] %}
{{ file.url }}
{{ file.name }}
{{ file.date }}
{{ file.slug }}
{{ file.title }}
{% enddirectory %}
```

##### Options:

- `reverse` - Defaults to 'false', ordering files the same way `ls` does: 0-9A-Za-z.
- `exclude` - Defaults to '.html$', a Regexp of files to skip.

##### File Attributes:

- `url` - The absolute path to the published file
- `name` - The basename
- `date` - The date extracted from the filename, otherwise the file's creation time
- `slug` - The basename with date and extension removed
- `title` - The titlecase'd slug