Reputation: 3800
I'm writing a Liquid template for Jekyll, and wish to do something like so:
{% for example in examples | limit:{{ site.examplelimit}} %}
However, this never works. {{ site.examplelimit}}
returns a value, and even something more precise like preceding the above with:
{% capture examplelimitint %}site.examplelimit{% endcapture %}
{% assign examplelimitint = examplelimitint | plus:0 %}
...doesn't help.
So, is there really no way to use a variable for the value to limit in Liquid?
Upvotes: 0
Views: 261
Reputation: 52829
You can try :
{% for example in examples | limit: site.examplelimit %}
Upvotes: 3