Reputation: 393
Is there any way to do something like this?
{% if file.basename contains {{basename}} %}
All the examples I have seen explicitly use a value, like this:
{% if file.basename contains 'image' %}
If it matters, I'm trying to loop through site.static_files
and only capture the files whose basename matches a variable passed in through an include.
Upvotes: 4
Views: 525
Reputation: 887275
You can use the variable directly as an expression:
{% if file.basename contains basename %}
The {{
syntax is only used to print expressions from markup.
Upvotes: 5