mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
561 B
561 B
title | date | description | categories | menu | signature | aliases | hugoversion | relatedfuncs | toc | draft | needsexamples | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cond | 2017-09-08 | Return one of two arguments, depending on the value of a third argument. |
|
|
|
|
0.27 |
|
false | false | false |
cond
returns VAR1 if CONTROL is true, or VAR2 if it is not.
Example:
{{ cond (eq (len $geese) 1) "goose" "geese" }}
Would emit "goose" if the $geese
array has exactly 1 item, or "geese" otherwise.