I'm getting this output from my Jekyll website generator
Liquid Exception: Tag '{%' was not properly terminated with regexp: /\%}/
What's going on?
I'm getting this output from my Jekyll website generator
Liquid Exception: Tag '{%' was not properly terminated with regexp: /\%}/
What's going on?
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.
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 replacemarkdownify
formarkdownize
and it works.
It did work for me.
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.
I got this error while updating this:
{%- assign img_url = product | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
To this:
{{ product | img_url: '1x1' | replace: '_1x1.', '_{width}x.' }}
Error:
Liquid syntax error (line 7): Variable '{{ product | img_url: '1x1' | replace: '_1x1.', '_{width}' was not properly terminated with regexp: /\}\}/
I had to break it up into two steps. Removing the replace
stopped the error, but moving the replace
into the {{ }}
tags causes it to come back.
{%- assign img_url = product | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{{ img_url }}
© 2022 - 2024 — McMap. All rights reserved.