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

index doesn't work for array #230

Closed
hekinami opened this issue Oct 25, 2018 · 4 comments
Closed

index doesn't work for array #230

hekinami opened this issue Oct 25, 2018 · 4 comments
Labels
bug Not as expected

Comments

@hekinami
Copy link

for example, if we use {{ collections.posts.pages[0] }}, the error occurs while build

Error: build command failed
Caused by: Failed to render content for "index.html"
Caused by: liquid: Invalid index
with:
index=collections.posts.pages

@epage
Copy link
Member

epage commented Oct 25, 2018

What version of cobalt?

@hekinami
Copy link
Author

Cobalt 0.13.2

I installed with cargo

@epage
Copy link
Member

epage commented Nov 16, 2018

Thanks Got it reproducing and are working on a fix and improving the error messages.

@epage epage transferred this issue from cobalt-org/cobalt.rs Nov 17, 2018
@epage epage added the bug Not as expected label Nov 17, 2018
epage added a commit to epage/liquid-rust that referenced this issue Nov 17, 2018
The parser is pretty messed up.  I have no idea why it does what it does
but it has two different code paths for parsing variables.  In one, it
somehow was treationg `a.b` as a variable `"a.b"` and not `a["b"]`.

Not sure why it broke but it now works.

Fixes cobalt-org#230
epage added a commit to epage/liquid-rust that referenced this issue Nov 17, 2018
The parser is pretty messed up.  I have no idea why it does what it does
but it has two different code paths for parsing variables.  In one, it
somehow was treationg `a.b` as a variable `"a.b"` and not `a["b"]`.

Not sure why it broke but it now works.

Fixes cobalt-org#230
epage added a commit to epage/liquid-rust that referenced this issue Nov 17, 2018
The parser is pretty messed up.  I have no idea why it does what it does
but it has two different code paths for parsing variables.  In one, it
somehow was treationg `a.b` as a variable `"a.b"` and not `a["b"]`.

Not sure why it broke but it now works.

Fixes cobalt-org#230
@epage
Copy link
Member

epage commented Nov 17, 2018

Got the fix in liquid; created PR cobalt-org/cobalt.rs#551 to update cobalt to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not as expected
Projects
None yet
Development

No branches or pull requests

2 participants