Skip to content

Instantly share code, notes, and snippets.

@linchpinstudios
Last active April 16, 2020 15:57
Show Gist options
  • Save linchpinstudios/437032c32bc4e684392a to your computer and use it in GitHub Desktop.
Save linchpinstudios/437032c32bc4e684392a to your computer and use it in GitHub Desktop.
Loop through jade adding a row every around every two items.
- var perRow = 2;
- var columnAry = new Array(perRow);
- for(var i = 0, nbRows = items.length/perRow; i < nbRows; i++) {
.row
each item,index in columnAry
if items[perRow*i+index]
.item #{items[perRow*i+index]}
- }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment