jekyll: "Invalid syntax for include tag" for includes using variables in parameters

Liquid Exception: Invalid syntax for include tag: ' alt='{{ contenttitle | strip_html | xml_escape }}' class='fullsize' Valid syntax: {% include file.ext param='value' param2='value' %} in _includes/maincontent_header.html, included in _layouts/page.html
jekyll 2.0.0 | Error:  Invalid syntax for include tag:

  ' alt='{{ contenttitle | strip_html | xml_escape }}' class='fullsize'

Valid syntax:

  {% include file.ext param='value' param2='value' %}

First I thought this error depends on the liquid version but it’s shown first with Jekyll 2.0.0 (without changing the liquid version). It worked to use vars in includes until Jekyll 1.5.1. In later Jekyll versions (e.g. 2.3.0) the var is even replaced by its value in the error message but it still doesn’t work again.

It’s probably one of the most important features that includes can used dynamically with vars.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Please submit a PR if you’d like to see this feature.