<figure class="{{ include.class }}">
  {%- if include.popup -%}<a href="{{ include.image_path | relative_url }}" class="image-popup"{% if include.caption %} title="{{ include.caption | markdownify | strip_html }}"{% endif %}>{%- endif -%}
  <img src="{{ include.image_path | relative_url }}"
       alt="{% if include.alt %}{{ include.alt | escape_once }}{% endif %}">
  {%- if include.popup -%}</a>{%- endif -%}
  {%- if include.caption -%}
    <figcaption>
      {{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}
    </figcaption>
  {%- endif -%}
</figure>
