I have used this answer https://stackoverflow.com/a/34783367/1279102; but am unable to work out how to use a variable folder.
{% for image in site.static_files %}
{% if image.path contains '{{ page.gallery }}' %}
<img src="{{ site.baseurl }}{{ image.path }}" alt="image" />
{% endif %}
{% endfor %}
I have added 'gallery' to the front matter of my post. I have tried using the absolute path, and the relative path.
It appears that no matter how you add the {{ page.gallery }}
variable in the if
portion, it is not changed to the corrected value.
What am I missing?