Skip to content

Instantly share code, notes, and snippets.

@medwards
Created March 16, 2012 11:55
Show Gist options
  • Save medwards/2049762 to your computer and use it in GitHub Desktop.
Save medwards/2049762 to your computer and use it in GitHub Desktop.
{% set row_blocks = [] %}
{% for item in items %}
{%- if row_width + item.width > 12 %}
{%- include "rowofstuff.html" %}
{%- for rowitem in row_blocks %}
{%- set something = row_blocks.remove(rowitem) %}
{%- endfor %}
{%- set row_width = 0 %}
{%- endif %}
{%- set something = row_blocks.append(item) %}
{%- set row_width = row_width + item.width %}
{% endfor %}
{% if row_blocks %}
{%- include "rowofstuff.html" %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment