add image helper for easier image insertion in posts
This commit is contained in:
parent
25a92c181a
commit
eedf838d1f
1 changed files with 14 additions and 0 deletions
14
_includes/image
Normal file
14
_includes/image
Normal 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>
|
Loading…
Reference in a new issue