Ad

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 ?

Ad

Answer

If you read jekyll/tags/include.rb code, 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 to blog_comments/Malayalam.html ;-)

Note: You can have a page or a collection item (including posts) with a name containing മലയാളം

Ad
source: stackoverflow.com
Ad