The liquid documentation states that
By including hyphens in your assign tag, you can strip the generated whitespace from the rendered template ... if you don't want any of your tags to output whitespace, as a general rule you can add hyphens to both sides of all your tags ({%- and -%}):
When I try in jekyll
{%- case key -%}
I get the error
Error: Liquid syntax error (line 139): Tag '{%- case key -%}' was not
properly terminated with regexp: /\%\}/
There are many posts about excessive whitespace in the jekyll generated html, for example Compressing Liquid generated code.
They all complain about dilute HTML output and discuss plug-ins as solution. My simple questions are:
{%- ... -%}
not work in jekyll ?Jekyll < v3.5.0 use liquid v3.0.6. White space control is only available in liquid v4 and this version will soon land in Jekyll.
As of 18 June 2017, Jekyll v3.5.0 has upgraded to Liquid v4. {%- ... -%}
now works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With