The following Pug script:
- data = [ \"A\", \"B\", \"C\", \"D\" ]
- for (i=0,i
Pug, by nature, doesn't allow that kind of "extra" indentation within the else
block. To achieve your desired result, you could think about it like this—
- var data = [ "A", "B", "C", "D" ]
each datum, index in data
if ((index % 2) == 0)
.row
.col #{datum}
if (data[index + 1])
.col #{data[index + 1]}
—which yields—
A
B
C
D