mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	Add template function slice
This commit is contained in:
		
				
					committed by
					
						 Bjørn Erik Pedersen
						Bjørn Erik Pedersen
					
				
			
			
				
	
			
			
			
						parent
						
							9349a889e2
						
					
				
				
					commit
					c1f8b188f7
				
			| @@ -75,6 +75,18 @@ or Create a map on the fly to pass into | ||||
|      | ||||
|  | ||||
|  | ||||
| ### slice | ||||
|  | ||||
| `slice` allows you to create an array (`[]interface{}`) of all arguments that you pass to this function. | ||||
|  | ||||
| One use case is the concatenation of elements in combination with `delimit`: | ||||
|  | ||||
| ```html | ||||
| {{ delimit (slice "foo" "bar" "buzz") ", " }} | ||||
| <!-- returns the string "foo, bar, buzz" --> | ||||
| ``` | ||||
|  | ||||
|  | ||||
| ### echoParam | ||||
| Prints a parameter if it is set. | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user