jekyll 中的白色 space 控件 - 为什么 {%- ... -%} a la liquid 不起作用?
white space control in jekyll - why does {%- ... -%} a la liquid not work?
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 -%}):
当我在 jekyll 中尝试时
{%- case key -%}
我收到错误
Error: Liquid syntax error (line 139): Tag '{%- case key -%}' was not
properly terminated with regexp: /\%\}/
在生成的 jekyll 中有很多关于空格过多的帖子 html,例如 Compressing Liquid generated code。
他们都抱怨稀释 HTML 输出并讨论插件作为解决方案。
我的简单问题是:
- 为什么
{%- ... -%}
在 jekyll 中不起作用?
- 为什么 jekyll 的行为与 liquid 文档建议的不同
Jekyll < v3.5.0 使用 liquid v3.0.6。
白色space控件仅在liquid v4中可用,该版本即将登陆Jekyll。
截至 2017 年 6 月 18 日,Jekyll v3.5.0 已升级到 Liquid v4。 {%- ... -%}
现在有效。
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 -%}):
当我在 jekyll 中尝试时
{%- case key -%}
我收到错误
Error: Liquid syntax error (line 139): Tag '{%- case key -%}' was not
properly terminated with regexp: /\%\}/
在生成的 jekyll 中有很多关于空格过多的帖子 html,例如 Compressing Liquid generated code。
他们都抱怨稀释 HTML 输出并讨论插件作为解决方案。 我的简单问题是:
- 为什么
{%- ... -%}
在 jekyll 中不起作用? - 为什么 jekyll 的行为与 liquid 文档建议的不同
Jekyll < v3.5.0 使用 liquid v3.0.6。 白色space控件仅在liquid v4中可用,该版本即将登陆Jekyll。
截至 2017 年 6 月 18 日,Jekyll v3.5.0 已升级到 Liquid v4。 {%- ... -%}
现在有效。