hacks-guide-minimal-mistake.../_includes/image
Fernando Ribeiro da95259743 Do not assume images would be placed in /assets/images/
In order to add an image to a post, just use the following syntax:

{% include image image_path="/full/path/to/MyPostImage.png" caption="The optional image caption" %}

or

{% include image image_path="https://example.com/images/MyPostImage.png" caption="The optional image caption" alt="The optional alt text" %}
2016-11-08 20:15:41 +00:00

13 lines
417 B
Plaintext

<figure class="{{ include.class }}">
<img src=
{% if include.image_path contains "://" %}
"{{ include.image_path }}"
{% else %}
"{{ include.image_path | absolute_url }}"
{% endif %}
alt="{% if include.alt %}{{ include.alt }}{% endif %}">
{% if include.caption %}
<figcaption>{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}</figcaption>
{% endif %}
</figure>