vf-figure.njk 1.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
{%- if context %}
  {% set id = context.id %}
  {% set vf_figure__align_inline_start = context.vf_figure__align_inline_start %}
  {% set vf_figure__align_inline_end = context.vf_figure__align_inline_end %}
  {% set vf_figure__align_centered = context.vf_figure__align_centered %}
  {% set override_class = context.override_class %}
  {% set imageUrl = context.imageUrl %}
  {% set alttext = context.ovealttextrride_class %}
  {% set html = context.html %}
  {% set text = context.text %}
{% endif -%}

13 14 15 16 17 18 19 20 21
<figure
  {#- You're using an ID? Really?? That'll go here -#}
  {%- if id -%} id="{{-id-}}" {%- endif %}
  class="vf-figure
  {%- if vf_figure__align_inline_start %} vf-figure--align vf-figure--align-inline-start{% endif -%}
  {%- if vf_figure__align_inline_end %} vf-figure--align vf-figure--align-inline-end{% endif -%}
  {%- if vf_figure__align_centered %} vf-figure--align vf-figure--align-centered{% endif -%}
  {%- if override_class %} | {{override_class}}{% endif -%}"
>
22
  <img class="vf-figure__image" src="{{imageUrl}}" alt="{{alttext}}" loading="lazy">
23 24 25
  <figcaption class="vf-figure__caption">
    {{- html | safe if html else text -}}
  </figcaption>
Ken Hawkins's avatar
Ken Hawkins committed
26
</figure>