Shopify Liquid Syntax - What is the difference between {%- assign [some_var] = [some_val] -%} and {% assign [some_var] = [some_val] %}
When yo use {% assign variable = value %}
you keep any white space if there is any.
But if you use {%- assign variable = value -%}
the white space is stripped.
That's the main difference.
PS: This is true for any liquid operation{%- if -%}, {%- capture -%}
etc.. even if you like to output something like so {{- -}}
.