jekyll - Error in Liquid templating when including non-english (UTF-8) filenamed files
I have a html file in a non-english langauge ( മലയാളം.html ). If I try to include this html file using the below code, I am getting the below shown error.
{% include blog_comments/മലയാളം.html %}
By the way I am using Jekyll. But I believe the error is from Liquid
Regenerating: 1 file(s) changed at 2016-05-05 09:49:14 Liquid Exception: Invalid syntax for include tag. File contains invalid characters or sequences: blog_comments/മലയാളം.html Valid syntax: {% include file.ext param='value' param2='value' %} in _includes/post_comments.html, included in _layouts/post.html
Does anyone know how to get the file മലയാളം.html included ?
Answer
Solution:
If you read jekyll/tags/include.rb code (https://github.com/jekyll/jekyll/blob/3.0-stable/lib/jekyll/tags/include.rb#L58), you can see that file names are validated against a regular expression, which main part is :
/^[a-zA-Z0-9_\/\.-]+$/
That means that includes names cannot contain something else than european alphabet letters (lower or upper case), numbers or /, _ , - and .
You will have to rename it toblog_comments/Malayalam.html
;-)
Note: You can have a page or a collection item (including posts) with a name containingമലയാളം
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.