image include
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Sergio Álvarez 2022-08-23 17:10:26 +02:00
parent 8c5f777c32
commit d39ebe1367
No known key found for this signature in database
GPG Key ID: 622780889DFDBDA5
1 changed files with 9 additions and 0 deletions

9
_includes/image.html Normal file
View File

@ -0,0 +1,9 @@
{% capture imagePath %}{{ page.date | date: "%Y-%m-%d" }}-{{ page.title | slugify }}/{{ include.name }}{% endcapture %}
{% if include.caption %}
<figure>
<img src="/assets/posts/{{ imagePath }}" {% if include.alt %} alt="{{ include.alt }}" {% endif %} {% if include.width %} width="{{ include.width }}" {% endif %}/>
<figcaption>{{ include.caption }}</figcaption>
</figure>
{% else %}
<img src="/assets/posts/{{ imagePath }}" {% if include.alt %} alt="{{ include.alt }}" {% endif %} {% if include.width %} width="{{ include.width }}" {% endif %}/>
{% endif %}