I'm using HAML with Locomotive CMS's liquid templates. Recently, I received the following error:

Liquid::SyntaxError at /
Tag '{%' was not properly terminated with regexp: /\%\}/

I'm using a block tag to add classes to a li by overriding it from child template files. FYI, I'm using Liquid Inheritance which is included into Locomotive's Liquid fork.

%li.menu-list-item{:class => "{% block 'at_about_page' %}{% endblock %}"}
有帮助吗?

解决方案

Turns out I couldn't have both a .class in HAML format and also specify a {:class => ""} tag block.

Moving menu-list-item into the class attribute defined afterward works:

%li{:class => "menu-list-item {% block 'at_about_page' %}{% endblock %}"}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top