我找不到关于liquid / jekyll是否可以处理while
循环的任何信息。所以要么没有人问这个问题,要么Google没有帮助。这不是可以做的事吗?我基本上希望能够做到这样的事情:
<!-- creates the 'counter' variable-->
{% assign counter = 0 %}
<!-- while 'counter' is less than 10, do some stuff -->
{% while counter < 10 %}
<!-- the stuff to be done followed by an increase in the 'counter' variable -->
{% assign counter = counter | plus: 1 %}
<!-- the completion of the loop -->
{% endwhile %}
答案 0 :(得分:6)
没有在Liquid中循环。
您可以根据需要使用这样的for循环
{% for counter in (0..9) %}
<!-- the stuff to be done followed by an increase in the 'counter' variable -->
{{ counter }}
{% endfor %}