Unless

v1.9.1

if 相反 —— 条件 不满足 时执行代码块。

输入

{% unless product.title == "Awesome Shoes" %}
  These shoes are not awesome.
{% endunless %}

输出

These shoes are not awesome.

等价于执行下面的代码:

{% if product.title != "Awesome Shoes" %}
  These shoes are not awesome.
{% endif %}