1
votes

The following code error saying "Invalid syntax for include tag. File contains invalid characters or sequences: photo-container.html category='korean' image='custom/gallery/korean/1.jpg' Valid syntax: {% include file.ext param='value' param2='value' %}"

      {% for i in (1..1) %}
        {% include photo-container.html category='korean' image='custom/gallery/korean/{{i}}.jpg' %}
      {% endfor %}

I wonder if it's possible, and if it is, how.

1

1 Answers

1
votes

In jekyll inclusions, you can pass parameters as strings or variables like {% include p.html param1="my string" param2=myVar %}. But a variable in a string will not be processed.

The solution is to concatenate your string and assign it to a variable.

{% capture myVar %}My string text {{ anyVar }} text end{% end capture %}
or
{% assign myVar="My string text" | append: anyVar | append: "text end" %}
{% include page.html param1=myVar %}