Feat: Implement dynamic {% include %} tags.
I found it useful to be able to include different files based on the content of variables, e.g.
{% for year in 2014,2015,2016 %}
{% include 'gallery-{year}.html' %}
{% endfor %}
This commit implements this.
I am not sure if we should introduce string interpolation only on include tag, this should be rather consistent in other places.
I'd think supporting variable lookup on include tag is probably a better way to go.
{% for partial in page.partials %}
{% include partial %}
{% endfor %}
Variable lookup on the include tag would not solve the problem I had:
I had a list of years (either a literal list or in a variable), but I wanted my templates to have
descriptive names, e.g. gallery-2005.html, not just 2005. I could have of course constructed the
names in PHP, but that seems to defeat the purpose of having a template engine.
I agree that consistency would be nice. If you decide that string interpolation is reasonable, I will try to look into that. I guess, for consistency's sake, it would also be better to have 'gallery-{{year}}.html' (i.e. double curly braces instead of single ones).