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
Add a group_by filter. #1738
Add a group_by filter. #1738
Conversation
@mattr- I think I'm going to need your thoughts on this one. Code could definitely be loads better but my tired mind isn't interested in building it right now. |
Also /cc @haacked |
# {"name" => "larry" | ||
# "items" => [...] } # all the items where `property` == "larry" | ||
def group_by(input, property) | ||
if input.respond_to?(:group_by) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps:
if groupable?(input)
where groupable
is defined as:
def groupable?(element)
element.respond_to?(:group_by)
end
@mattr- Did everything else look OK to you? |
I think so. I'll look at it again. |
@mattr- Awesome, thanks! Please comment on the weird spots or merge if it's good. :) |
Move jekyllrb.com CSS to includes & Update Normalize.css to v2.1.3
…p-by-filter * 'group-by-filter' of github.com:mojombo/jekyll: Add groupable? method, props @mattr- First (terrible) pass at a group_by filter.
CAUTION: current code is total crap. Don't code tired, kiddies.
#1735