Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables don't work in include_relative tag #3038

Closed
jschaf opened this issue Oct 30, 2014 · 3 comments
Closed

Variables don't work in include_relative tag #3038

jschaf opened this issue Oct 30, 2014 · 3 comments

Comments

@jschaf
Copy link

jschaf commented Oct 30, 2014

Jekyll fails to build the following file:

{% for rust_file in site.data.rust_files %}
    {% include_relative {{ rust_file }} %}
{% endfor %}

Errror:

Liquid Exception: Variable '{{{}' was not properly terminated with regexp: /\}\}/ in ./{{ rust_file }}, included in index.html
...error:
             Error: Variable '{{{}' was not properly terminated with regexp: /\}\}/
             Error: Run jekyll build --trace for more information.

Similar issues were resolved with the include tag in #1841 and #1495.

@parkr
Copy link
Member

parkr commented Oct 30, 2014

Did you try

{% for rust_file in site.data.rust_files %}
    {% include_relative {{rust_file}} %}
{% endfor %}

@jschaf
Copy link
Author

jschaf commented Oct 30, 2014

Okay, I misreported, variables work as advertised with both include and include_relative. The issue actually involves content of one of the included files. Specifically, this line:

        _ => format!("{{{} and {}}}", seq.init().connect(", "), seq.last().unwrap())

which can be reduced to this case:

{{

Jekyll is trying to interpret this as the start of a tag, but it's just code. Is there a way to "raw" include a file so that no processing occurs?

@parkr
Copy link
Member

parkr commented Oct 30, 2014

no raw includes, but you can use the {% raw %} ... {% endraw %} block. that should solve your issue.

@parkr parkr closed this as completed Oct 30, 2014
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants