mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	doc: Merge commit '2c0d1ccdcd95de0bddeb39dca2e4d08f0d8056d7'
This commit is contained in:
		@@ -21,7 +21,7 @@ aliases: []
 | 
			
		||||
 | 
			
		||||
Given two arrays (or slices) A and B, this function will return a new array that contains the elements or objects that belong to either A or to B or to both. The elements supported are strings, integers, and floats (only float64).
 | 
			
		||||
 | 
			
		||||
```golang
 | 
			
		||||
```
 | 
			
		||||
{{ union (slice 1 2 3) (slice 3 4 5) }}
 | 
			
		||||
<!-- returns [1 2 3 4 5] -->
 | 
			
		||||
 | 
			
		||||
@@ -38,7 +38,7 @@ Given two arrays (or slices) A and B, this function will return a new array that
 | 
			
		||||
 | 
			
		||||
This is also very useful to use as `OR` filters when combined with where:
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
```
 | 
			
		||||
{{ $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) }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user