Unverified Commit 658071aa authored by Ken Hawkins's avatar Ken Hawkins Committed by GitHub
Browse files

Chore: vf-figure support passed context (#1726)

https://github.com/visual-framework/vf-core/issues/1509
parent 7531ed17
Pipeline #218075 passed with stages
in 6 minutes and 54 seconds
### 2.0.1
* Support passed context.
* https://github.com/visual-framework/vf-core/issues/1509
### 2.0.0 ### 2.0.0
* Removed `width: 100%` from the `.vf-figure__image` class. * Removed `width: 100%` from the `.vf-figure__image` class.
......
{%- 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 -%}
<figure <figure
{#- You're using an ID? Really?? That'll go here -#} {#- You're using an ID? Really?? That'll go here -#}
{%- if id -%} id="{{-id-}}" {%- endif %} {%- if id -%} id="{{-id-}}" {%- endif %}
class="vf-figure class="vf-figure
{%- if vf_figure__align_inline_start %} vf-figure--align vf-figure--align-inline-start{% endif -%} {%- 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_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 vf_figure__align_centered %} vf-figure--align vf-figure--align-centered{% endif -%}
{%- if override_class %} | {{override_class}}{% endif -%}" {%- if override_class %} | {{override_class}}{% endif -%}"
> >
<img class="vf-figure__image" src="{{imageUrl}}" alt="{{alttext}}" loading="lazy"> <img class="vf-figure__image" src="{{imageUrl}}" alt="{{alttext}}" loading="lazy">
<figcaption class="vf-figure__caption"> <figcaption class="vf-figure__caption">
{{- html | safe if html else text -}} {{- html | safe if html else text -}}
</figcaption> </figcaption>
</figure> </figure>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment