【问题标题】:Locomotive Liquid::SyntaxError at / Tag '{%' was not properly terminated with regexp: /\%\}/Locomotive Liquid::SyntaxError at / Tag '{%' 没有被正则表达式正确终止:/\%\}/
【发布时间】:2013-08-22 02:57:31
【问题描述】:

我正在将 HAML 与 Locomotive CMS 的液体模板一起使用。最近收到如下错误:

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

我正在使用块标记将类添加到li,方法是从子模板文件中覆盖它。仅供参考,我正在使用包含在 Locomotive 的 Liquid fork 中的 Liquid Inheritance。

%li.menu-list-item{:class => "{% block 'at_about_page' %}{% endblock %}"}

【问题讨论】:

    标签: ruby-on-rails haml liquid locomotivecms


    【解决方案1】:

    事实证明,我不能同时拥有 HAML 格式的 .class 并指定 {:class => ""} 标记块。

    menu-list-item 移动到之后定义的类属性中:

    %li{:class => "menu-list-item {% block 'at_about_page' %}{% endblock %}"}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多