osteele / liquid

A Liquid template engine in Go
https://godoc.org/github.com/osteele/liquid
MIT License
287 stars 59 forks source link

Allow loop modifiers to be more than just literals #67

Closed aisbergg closed 1 year ago

aisbergg commented 2 years ago

This PR adds the ability to specify variables and expressions in loop modifiers. Example:

{% assign limit = 3 %}
{% assign offset = 1 %}
{% for i in (1..5) limit:limit offset:offset %}
{{ i -}}
{%- endfor %}

results in:

2
3
4

Checklist