{% capture imagePath %}/assets/blog/{{ page.id | split: "/" | last }}/{{ include.name }}{% endcapture %}

{% assign imagePath=(imagePath | relative_url) %}

{% capture src %}src="{{ imagePath }}"{% endcapture %}

{% assign caption=include.caption | default: "" %}
{% assign alt=include.alt | default: caption %}

{% if alt != blank %}
	{% capture alt %}alt="{{ alt }}" title="{{ alt }}"{% endcapture %}
{% endif %}

{% assign frame=include.frame | default: true %}

<figure class="figure {% if include.caption %}caption{% endif %} {% if frame %}frame{% endif %}">
	<a target="_blank" href="{{ imagePath }}"><img {{ src }} {{ alt }} width="100%" /></a>
	{% if caption != blank %}<figcaption>{{ caption }}</figcaption>{% endif %}
</figure>