Last active
April 7, 2018 12:06
-
-
Save maoo/c41d6ebb48af5165812f74d264c14d4e to your computer and use it in GitHub Desktop.
Hubspot - Multiple columns in blog listing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set items = contents|length %} | |
{# Change '3' with the number of columns you'd like to display #} | |
{% set itemsPerColumn = items|divide(3) %} | |
{% for row in contents|batch(itemsPerColumn, ' ') %} | |
<div class="column span{{ itemsPerColumn }}"> | |
{% for content in row %} | |
<div class="post-item"> | |
.... | |
</div> | |
{% endfor %} | |
</div> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment