{% if page.assets %}
{% capture imagePath %}{{ page.assets | slugify }}/{{ include.name }}{% endcapture %}
{% else %}
{% capture imagePath %}{{ page.title | slugify }}/{{ include.name }}{% endcapture %}
{% endif %}
{% if include.caption %} <figure> <img src=“{{ site.baseurl }}/static/assets/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 }}/static/assets/posts/{{ imagePath }}” {% if include.alt %} alt=“{{ include.alt }}” {% endif %} {% if include.width %} width=“{{ include.width }}” {% endif %}/> {% endif %}