From 2f660674c3044a818170209aea4803d3ecf31ea0 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 5 May 2014 23:37:25 -0400 Subject: [PATCH] Add docs for group_by and where filters --- site/docs/templates.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/site/docs/templates.md b/site/docs/templates.md index a4c79184..12ae5d41 100644 --- a/site/docs/templates.md +++ b/site/docs/templates.md @@ -79,6 +79,32 @@ common tasks easier.

+ + +

Where

+

Select all the object in an array where the key has the given.

+ + +

+ {% raw %}{{ site.members | where:"graduation_year","2014" }}{% endraw %} +

+ + + + +

Group By

+

Group an array's items by a given property.

+ + +

+ {% raw %}{{ site.members | group_by:"graduation_year" }}{% endraw %} +

+

+ [{"name"=>"2013", "items"=>[...]}, +{"name"=>"2014", "items"=>[...]}] +

+ +

XML Escape