Created
January 27, 2020 18:11
-
-
Save twentyfortysix/4e685daf890dd75fa69aff419848cb6d to your computer and use it in GitHub Desktop.
divide for loop by n
This file contains hidden or 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
{% for col in posts|batch((posts|length / 2)|round(0, 'ceil')) %} | |
<div class="col-12 col-sm-6"> | |
{% for item in col %} | |
<a href="{{ item.link }}"> | |
{{ item.title }} | |
</a> | |
{% endfor %} | |
</div> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment