Sha256: 705f511f4f4aa9a6faf91b58368f9dfeb673e6d9df02adbc4379cd26398bd1f7

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

{%- assign list_items = include.list_items -%}
{%- assign list_type = include.list_type -%}

<div class="archive-list">
  {%- if list_type == "posts" -%}
    {% assign posts_by_years = list_items | group_by_exp: 'post', 'post.date | date: "%Y"' %}
    {% for year in posts_by_years %}
      <a data-toggle="collapse" href="#posts_in_{{ year.name }}" role="button" aria-expanded="false"
          aria-controls="posts_in_{{ year.name }}">
          <h2 id="posts_in_{{ year.name }}_heading">{{ year.name }}</h2>
      </a>
      <div class="collapse show" id="posts_in_{{ year.name }}">
        <ul>
          {% for post in year.items %}
            {% include archive-single.html item=post %}
          {% endfor %}
        </ul>
      </div>
    {% endfor %}
  {%- else -%}
    {% assign taxonomies = list_items %}
    {% for taxonomy in taxonomies %}
      {%- capture tax_0 -%} {{ taxonomy[0] | slugify }} {%- endcapture -%}
      <a data-toggle="collapse" href="#posts_in_{{ tax_0 }}" role="button" aria-expanded="false"
          aria-controls="posts_in_{{ tax_0 }}">
          <h2 id="posts_in_{{ tax_0 }}_heading">{{ tax_0 }}</h2>
      </a>
      <div class="collapse show" id="posts_in_{{ tax_0 }}">
        <ul>
          {% for post in taxonomy[1] %}
              {% include archive-single.html item=post %}
          {% endfor %}
        </ul>
      </div>
    {% endfor %}
  {%- endif -%}
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lone-wolf-theme-1.2.0 _includes/archive-list.html
lone-wolf-theme-1.1.1 _includes/archive-list.html
lone-wolf-theme-1.1.0 _includes/archive-list.html