Skip to content

Add the {% with %} tag#4

Merged
jg-rp merged 1 commit intomainfrom
with-tag
May 9, 2025
Merged

Add the {% with %} tag#4
jg-rp merged 1 commit intomainfrom
with-tag

Conversation

@jg-rp
Copy link
Copy Markdown
Owner

@jg-rp jg-rp commented May 9, 2025

Add an implementation of the {% with %} tag.

The with tag extends the template namespace with block scoped variables. These variables have the potential to temporarily shadow global variables or variables assigned with {% assign %} and {% capture %}.

{% with p: collection.products.first %}
  {{ p.title }}
{% endwith %}

{% with a: 1, b: 3.4 %}
  {{ a }} + {{ b }} = {{ a | plus: b }}
{% endwith %}

@jg-rp jg-rp merged commit 3613af0 into main May 9, 2025
8 checks passed
@jg-rp jg-rp deleted the with-tag branch May 9, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant