-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Liquid include path as variable #209
Comments
You’re likely running into a discrepancy between Ruby liquid and LiquidJS. This is likely a good candidate for our “Common Pitfalls” documentation. Check out the You can enable this behavior in the Configuration API here: https://www.11ty.io/docs/languages/liquid/ This will let you do See also previous issues #177 and #73 for additional info. Hope that helps! I’m going to close this for now but feel free to continue commenting here with more questions! |
Thanks, @zachleat |
Definitely stick with Have you reviewed https://www.11ty.io/docs/config/#directory-for-includes ? If your input directory is Does that make sense? You can change these directories in your config file. |
Please reopen if you have additional questions! |
Hi @zachleat, I've been playing around with eleventy and I'm actually considering it for my personal site. First of all, thanks for all your work on this 💟 I'm having an issue related to this (sorry if it's a liquidjs thing and not an eleventy one), my case is that I'm dynamically including a file but leventy takes its literal name instead. The file containing the include looks like this: <head>
{% capture stylesPath %}
styles/{{layout}}.liquid
{% endcapture %}
<style>{% include stylesPath %}</style>
</head> I have
Looks like eleventy doesn't understand that the name passed is a variable holding the actual path, am I missing something? |
So, quick update. I figure it out. The issue is that |
I just bumped into this and it ended up being whitespace inside <!-- ❌ Does NOT work, same error as OP described, and the file definitely exists -->
{% capture path %}
maps/{{ mapDataFile }}
{% endcapture %}
{% include path %}
<!-- ✅ DOES work -->
{% capture path %}maps/{{ mapDataFile }}{% endcapture %}
{% include path %} |
Hi -
Fantastic project! I've been using Eleventy for a few months now and reciently ran into something that doesn't seem quite right. I'm using Liquid and am attempting to create include path's dynamically by:
The
path
var inside the include throws a render error:Failed to lookup: project_name/logo-header.liquid
yet that file exists.Any guidance would be greatly appeaciated!
The text was updated successfully, but these errors were encountered: