Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
embl.org
vf-core-mirror
Commits
658071aa
Unverified
Commit
658071aa
authored
Nov 29, 2021
by
Ken Hawkins
Committed by
GitHub
Nov 29, 2021
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
components/vf-figure/CHANGELOG.md
components/vf-figure/CHANGELOG.md
+5
-0
components/vf-figure/vf-figure.njk
components/vf-figure/vf-figure.njk
+12
-5
No files found.
components/vf-figure/CHANGELOG.md
View file @
658071aa
### 2.0.1
*
Support passed context.
*
https://github.com/visual-framework/vf-core/issues/1509
### 2.0.0
*
Removed
`width: 100%`
from the
`.vf-figure__image`
class.
...
...
components/vf-figure/vf-figure.njk
View file @
658071aa
{%- 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
{#- 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 -%}"
>
<img class="vf-figure__image" src="{{imageUrl}}" alt="{{alttext}}" loading="lazy">
<figcaption class="vf-figure__caption">
{{- html | safe if html else text -}}
</figcaption>
</figure>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment