visionmedia/jade — Issue #452: each loop in sets/blocks
Author: joeframbach
Created: 2011-12-26 06:40:01+00:00
State: open

Suppose I have a variable such as

entries = [
'first',
'second',
'third',
'fourth',
'fifth'
];

I want to output it like

.row
.span9
p first
.span9
p second
.row
.span9
p third
.span9
p fourth
.row
.span9
p fifth

So far I have

each entry, entry_id in entries
- if (entry_id % 2 == 0) {
.row
- }
.span9
p #{entry}

I've tried a few variations of this, but it doesn't come out right. Any ideas?