mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 16:17:21 +00:00
Add template function slice
This commit is contained in:
1 parent
957b735fec
commit
034fd4adc1
1 file changed
+12
@@ -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