2020-08-22 18:07:48 +00:00
|
|
|
Simple filter to prefix all items from a list. Default prefix will be `--` but you can also pass a custom one.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```Yaml
|
|
|
|
my_list:
|
|
|
|
- item1
|
|
|
|
- item2
|
|
|
|
|
|
|
|
{{ my_list | prefix | join(' ') }}
|
|
|
|
|
|
|
|
# result:
|
|
|
|
# "--item1 --item2"
|
|
|
|
```
|
|
|
|
|
|
|
|
Or pass a custom prefix:
|
2023-12-15 12:05:48 +00:00
|
|
|
|
2020-08-22 18:07:48 +00:00
|
|
|
```Yaml
|
|
|
|
my_list:
|
|
|
|
- item1
|
|
|
|
- item2
|
|
|
|
|
|
|
|
{{ my_list | prefix(prefix='-') | join(' ') }}
|
|
|
|
|
|
|
|
# result:
|
|
|
|
# "-item1 -item2"
|
|
|
|
```
|