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

Liquid Warning: Expected dotdot but found pipe #917

Closed
edap opened this issue Aug 9, 2017 · 2 comments
Closed

Liquid Warning: Expected dotdot but found pipe #917

edap opened this issue Aug 9, 2017 · 2 comments

Comments

@edap
Copy link

edap commented Aug 9, 2017

I've got this warning "Liquid Warning: Liquid syntax error (line 11): Expected dotdot but found pipe in "{{(site.github.public_repositories | sort: 'stargazers_count') reverse }}" in tools.html"

And this is the snippet generating this error

  {% assign selected = "repo1,repo2,repo3" | split: "," %}
  {% assign sorted = (site.github.public_repositories | sort: 'stargazers_count') | reverse %}
  {% for repository in sorted  %}
    {% if selected contains repository.name %}
        {% include card.html repoName=repository.name  gridClass = "grid" %}
    {% endif %}
  {% endfor %}

I've tried to substiute the offending line with:

{% assign sorted = (site.github.public_repositories sort: 'stargazers_count') reverse %}

or

{% assign sorted = (site.github.public_repositories sort: 'stargazers_count') | reverse %}

or

{% assign sorted = (site.github.public_repositories | sort: 'stargazers_count') reverse %}

but the result does not change. What am I doing wrong?

@kainjow
Copy link
Contributor

kainjow commented Aug 9, 2017

IIRC, I don't think parentheses can be used in Liquid. Did you try this?

site.github.public_repositories | sort: 'stargazers_count' | reverse

@edap
Copy link
Author

edap commented Aug 9, 2017

it works, thanks @kainjow ;)

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

No branches or pull requests

2 participants