James Percival

My Github Pages material

Last updated : 30th August 2018

Note to self - disabling whitespace in liquid


It appears that when generating static websites using liquid, the default syntax,

{% for a in b %}
	{{ a }}
{% endfor %}

produces a newline in the raw html for each line of liquid. This can be prevented by using hyphens all over the place:

{%- for a in b -%}
	{{- a -}}
{%- endfor -%}

which looks really weird, but seems to curb its enthusiam.


tags: liquid jekyll