hugo/tpl/collections
Bjørn Erik Pedersen ccdd08d57a tpl/collections: Add Pages support to Intersect and Union
This enables `AND` (`intersect`)  and `OR` (`union`)  filters when combined with `where`.

Example:

```go
{{ $pages := where .Site.RegularPages "Type" "not in" (slice "page" "about") }}
{{ $pages := $pages | union (where .Site.RegularPages "Params.pinned" true) }}
{{ $pages := $pages | intersect (where .Site.RegularPages "Params.images" "!=" nil) }}
```

The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page params.

Fixes #3174
2017-07-03 21:48:03 +02:00
..
apply.go tpl/collections: Add Pages support to Intersect and Union 2017-07-03 21:48:03 +02:00
apply_test.go
collections.go tpl/collections: Add Pages support to Intersect and Union 2017-07-03 21:48:03 +02:00
collections_test.go tpl/collections: Add Pages support to Intersect and Union 2017-07-03 21:48:03 +02:00
index.go
index_test.go
init.go
init_test.go
reflect_helpers.go tpl/collections: Add Pages support to Intersect and Union 2017-07-03 21:48:03 +02:00
sort.go
sort_test.go
where.go tpl/collections: Add Pages support to Intersect and Union 2017-07-03 21:48:03 +02:00
where_test.go