Skip to content

Instantly share code, notes, and snippets.

@chrissy-dev
Created November 20, 2019 21:46
Show Gist options
  • Save chrissy-dev/d64cc55c734884f44ba6fb9adfd48877 to your computer and use it in GitHub Desktop.
Save chrissy-dev/d64cc55c734884f44ba6fb9adfd48877 to your computer and use it in GitHub Desktop.
---
title: "Freeridical"
date: 2019-10-25
images:
- small: small-1.jpg
large: large-1.jpg
alt: First image
- small: small-1.jpg
large: large-1.jpg
- small: small-1.jpg
large: large-1.jpg
alt: The one above had no alt
---
{% for image in images %}
<figure>
<picture>
<source media="(min-width: 1024px)"
srcset="/assets/posts/edited/{{ date | date: "%Y-%m-%d" }}-{{ title | slug }}/{{ image.large }}" />
<img src="/assets/posts/edited/{{ date | date: "%Y-%m-%d" }}-{{ title | slug }}/{{ image.small }}" {% if image.alt %} alt="{{ image.alt }}" {% endif %}>
</picture>
{% if image.alt %}<figcaption>{{ image.alt }}</figcaption>{% endif %}
</figure>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment