Sha256: 96934c9c77a0e44143528587f26ce2ab22f0cbdb76a4c09b86f0f27883933f3f

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

{% comment %}
  This requires an array with all cards named part.cards
{% endcomment %}

{% assign grid_width = 4 %}
{% assign grid_height = part.cards.size | divided_by: grid_width %}

<div class="columns">

{% for i in (1..grid_width) %}
  <div class="column is-3">

  {% for n in (0..grid_height) %}
    {% assign index = grid_width | times: n | plus: i | minus: 1 %}
    {% assign card = part.cards[index] %}

    {% if card == nil %}
      {% continue %}
    {% endif %}

    <div class="card">

    {% if card.image %}
      <div class="card-image">
        <figure class="image">
          {% assign link = card.image %}
          {% include util/prepend_link.html %}
          <img src="{{ link }}" alt="{{ card.title }}">
        </figure>
      </div>

    {% endif %}

      <div class="card-content">

      {% for item in card.content %}
        {% include util/items.html %}
      {% endfor %}

      </div> {% comment %} card-content {% endcomment %}
    </div> {% comment %} card {% endcomment %}

  {% endfor %}

  </div> {% comment %} container {% endcomment %}

{% endfor %}

</div> {% comment %} columns {% endcomment %}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vitrina-0.3.1 _includes/util/grid_columns.html
vitrina-0.3.0 _includes/util/grid_columns.html
vitrina-0.2.8 _includes/util/grid_columns.html
vitrina-0.2.6 _includes/util/grid_columns.html