For loop, wrap every two posts in a div
问题 Basically, I am using Jekyll (which uses the Liquid templating language) and I am trying to write a for loop which wraps every two items in a div . This is my current loop: <div> {% for post in site.posts %} <a href="{{ post.url }}">{{ post.title }}</a> {% endfor %} </div> Which would output four posts like so: <div> <a href="#">Title</a> <a href="#">Title</a> <a href="#">Title</a> <a href="#">Title</a> </div> My desired output for four posts is: <div> <a href="#">Title</a> <a href="#">Title<