How to fix: Liquid Exception: Tag '{%' was not properly terminated with regexp: /\%\}/?

给你一囗甜甜゛ 提交于 2019-12-10 18:54:32

问题


I'm getting this output from my Jekyll website generator

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

What's going on?


回答1:


It turns out that you've probably made a formatting error in your template. For example:

{% if site.ALERT 
or site.ALERT_en %}

will break but

{% if site.ALERT or site.ALERT_en %}

is fine.




回答2:


I had the issue with Octopress and the solution was to follow the advice by prigazzi:

The file that's causing this problem in octopress, is category_feed.xml, inside _includes/custom. You need to replace markdownify for markdownize and it works.

It did work for me.




回答3:


Jekyll may not properly tell you which included file the actual syntax error belongs in. For example, I got the same error telling me that my _layout/base.html had this error on line 5; but the syntax was fine: {% include head.html %}. The syntax of head.html was also fine; but it included another file (header.html) which had an incomplete {% for line that I was writing but didn't finish.

Basically... you may have to follow the breadcrumb trail until you get to your error.



来源:https://stackoverflow.com/questions/15586204/how-to-fix-liquid-exception-tag-was-not-properly-terminated-with-regexp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!