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 all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
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 tpl: Add template function namespaces 2017-04-30 10:56:38 +02:00
index_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
init.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
init_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
reflect_helpers.go tpl/collections: Add Pages support to Intersect and Union 2017-07-03 21:48:03 +02:00
sort.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
sort_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
where.go tpl/collections: Add Pages support to Intersect and Union 2017-07-03 21:48:03 +02:00
where_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00