summaryrefslogtreecommitdiff
path: root/_includes/views/segments.html
blob: 2c92dc18a6dfc29e18575e81ba6495fd78481e7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{%- if include.keys -%}
  {%- assign keys = include.keys -%}
{%- endif -%}

{%- if include.field -%}
  {%- assign field = include.field -%}
{%- endif -%}

<div class="page-segments">
  <ul class="page-segments-list">
    {% for key in keys %}
    <h2 id="{{ key }}" class="segment-name">{{ key }}</h2>
      {% assign items = site.posts | where: field, key %}
      {% for item in items %}
        {% if item != nil %}
        <li> {% include views/post-item.html %} </li>
        {% endif %}
      {% endfor %}
    {% endfor %}
  </ul>
</div>