{% if caption is not empty %}
  <figure class="{{ fig_class }}">
    {{ image }}
    {% if caption is not empty %}
      <figcaption>{{ caption }}</figcaption>
    {% endif %}
  </figure>
{% else %}
  {{ image }}
{% endif %}
