Skip to content
Discussion options

You must be logged in to vote

You could probably use LiquidJS's capture or Nunjucks' set paired tags, or eleventyComputed value, or just pass the global data file as an argument and do alt value in your shortcode function:

---
title: LiquidJS
eleventyComputed:
  altComputed: "{{ someData.patient.procedureName }} after {{ someData.patient.treatmentNumber }} treatments"
---

<h1>{{ title }}</h1>

{%- capture alt -%}
  {{ someData.patient.procedureName }} after {{ someData.patient.treatmentNumber }} treatments
{%- endcapture -%}

{%- respImage "a.jpg", alt %}
{%- respImage "b.jpg", altComputed %}
{%- respImage2 "c.jpg", someData %}
---
title: Nunjucks
eleventyComputed:
  altComputed: "{{ someData.patient.procedureName }}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@danielLee0721
Comment options

Answer selected by danielLee0721
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants