Skip to content

Instantly share code, notes, and snippets.

@shadowcodex
Created August 28, 2017 18:45
Show Gist options
  • Save shadowcodex/56f516a522b58797eaf9c7534147072b to your computer and use it in GitHub Desktop.
Save shadowcodex/56f516a522b58797eaf9c7534147072b to your computer and use it in GitHub Desktop.
Repeat section for every 4 items in data. Jekyll
{% assign rows = site.data.afcu-projects.size | divided_by: 4.0 | ceil %}
{% for i in (1..rows) %}
{% assign offset = forloop.index0 | times: 4 %}
<div class="row">
{% for proj in site.data.afcu-projects limit:4 offset:offset %}
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">{{proj.title}}</div>
<div class="panel-body">
<p>{{proj.description}}</p>
<p>{{proj.tech}}</p>
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment