liquid

Create array

{% capture _new_array %}

1

2

3

{% endcapture %}

{% assign _new_array = _new_array | strip | split: '\n' %}

Beware: False Positives in .liquid

❌ Wrong:


{% if my_string %} This will always show if the string exists, even if empty. {% endif %}

✅ Right (Checking for content):


{% if my_string != blank %} This only shows if there is actual text. {% endif %}

✅ Right (Checking arrays/strings by size):


{% if my_array.size > 0 %} This ensures the list isn't empty. {% endif %}