{% if page.filename %}

{% capture imagePath %}{{ page.filename | slugify }}/{{ include.name }}{% endcapture %}

{% else %}

{% capture imagePath %}{{ page.title | slugify }}/{{ include.name }}{% endcapture %}

{% endif %}

{% if include.caption %} <figure> <img src=“{{ site.baseurl }}/assets/images/posts/{{ imagePath }}” {% if include.alt %} alt=“{{ include.alt }}” {% endif %} {% if include.width %} width=“{{ include.width }}” {% endif %}/> <figcaption>{{ include.caption }}</figcaption> </figure> {% else %} <img src=“{{ site.baseurl }}/assets/images/posts/{{ imagePath }}” {% if include.alt %} alt=“{{ include.alt }}” {% endif %} {% if include.width %} width=“{{ include.width }}” {% endif %}/> {% endif %}