mojombo/jekyll — pull request #1789 by jens-na (2013-12-08 12:23:55+00:00)
Title: variables in include tag with filters

**Use variable {% include %} with filters**
This pull request adds support for filters when using the include tag with a variable.
To be more precise:

Since PR #1495 it is possible to use variables inside an include tag, like that:

```
{% for item in page.dependencies %}
{% include {{item}} %}
{% endfor %}
```
but unfortunately you cannot use filters.

With this pull reuqest you can use something like this:
```
{% for item in page.dependencies %}
{% include {{ item | append: '.html' }} %}
{% endfor %}
```

This is especially useful when you want to modify the file/filename which should get included.

**Possible use cases**

Append `.html` to the file name
```
{% include {{ item | append: '.html' }} %}
```

Make sure the file name is lowercase
```
{% include {{ item | downcase | append: '.html' }} %}
```

Prepend a directory to choose another directory inside the `_includes/` directory
```
{% include {{ item | downcase | prepend: '/dependencies/' | append: '.html' }} %}
==> ./_includes/dependencies/
.html
```