add image helper for easier image insertion in posts

This commit is contained in:
Fernando Ribeiro 2016-10-07 21:45:59 +01:00
parent 25a92c181a
commit eedf838d1f

14
_includes/image Normal file
View file

@ -0,0 +1,14 @@
{% include base_path %}
<figure class="{{ include.class }}">
<img src=
{% if include.image_path contains "://" %}
"{{ include.image_path }}"
{% else %}
"{{ include.image_path | prepend: "/assets/images/" | prepend: base_path }}"
{% endif %}
alt="{% if include.alt %}{{ include.alt }}{% endif %}">
{% if include.caption %}
<figcaption>{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}</figcaption>
{% endif %}
</figure>