-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Where filter always treats value as a string #3911
Labels
Comments
yeah, the input to that where filter is always a string. We should do a .to_s when looking at the value to check against |
This would be really useful in, for example, jekyll-sitemap, where we currently need an additional conditional in every loop. Being able to use the |
parkr
added a commit
that referenced
this issue
Aug 26, 2015
…rator Non-string input was being missed as a result of poor comparison. Converting inputs to strings ensure numerical and boolean values are properly compared. Fixes #3911.
👏 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I noticed recently that the
where:
filter treats the value option as a string, even if a boolean is used:Example post frontmatter:
Example usage of
where:
filter:The same result is seen if we wrap
true
in quotes on thewhere:
filter:To make this work I had to wrap the
true
in quotes in both cases:The text was updated successfully, but these errors were encountered: