spf13/hugo — pull request #413 by tatsushid (2014-08-16 07:07:36+00:00)
Title: Add 'where' template function

I added 'where' template function which is similar to [Jekyll's 'where' function](http://jekyllrb.com/docs/templates/). It selects all the structure objects, maps or those pointers in an array that the field or key has the given value and it can be used with three arguments 'array value', 'key or field name' and 'match value' like below

```
{{ range where .Data.Pages "Section" "post" }}
{{ .Content}}
{{ end }}
```

Of course, it can be used with 'first' function like

```
{{ range first 5 (where .Data.Pages "Section" "post") }}
{{ .Content}}
{{ end }}
```

It returns a error and stops site generation when it is called with non array value