jekyll-theme-isabelline/_includes/image.html
2020-05-31 16:26:49 -04:00

21 lines
779 B
HTML

{% capture imagePath %}/assets/blog/{{ page.id | split: "/" | last }}/{{ include.name }}{% endcapture %}
{% capture src %}src="{{ imagePath }}"{% endcapture %}
{% assign alt=include.alt | default: "" %}
{% if alt != blank %}
{% capture alt %}alt="{{ include.alt }}" title="{{ include.alt}}"{% endcapture %}
{% endif %}
{% assign caption=include.caption | default: "" %}
{% if alt == blank and caption != blank %}
{% assign alt=caption %}
{% 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>