Browse Source

image include

main
Sergio Álvarez 1 month ago
parent
commit
d39ebe1367
Signed by: salvarez
GPG Key ID: 622780889DFDBDA5
  1. 9
      _includes/image.html

9
_includes/image.html

@ -0,0 +1,9 @@ @@ -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 %}
Loading…
Cancel
Save