jekyll-theme-isabelline/_includes/image.html
2020-06-02 21:04:07 -04:00

19 lines
737 B
HTML

{% 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>