jekyll/jekyll — pull request #1841 by jens-na (2013-12-17 23:02:28+00:00)
Title: variables in include tag with liquid 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
```