Sha256: 6c558189419bb6526a1522366f01d9145482becdb6dc75afa25d303965b6e411

Contents?: true

Size: 1.99 KB

Versions: 1

Compression:

Stored size: 1.99 KB

Contents

---
layout: default
---

{% include site-nav.html %}

{% include header.html %}

<ul class="post-list">
  {% for rule in page.filter %}
  {% assign posts = site.posts %}
  {% if rule.by_tag %}
  {% assign posts = posts | where_exp: "post", "post.tags contains rule.by_tag" %}
  {% endif %}
  {% if rule.by_category %}
  {% assign posts = posts | where_exp: "post", "post.category == rule.by_category" %}
  {% endif %}
  {% if rule.by_expression %}
  {% assign posts = posts | where_exp: "post", rule.by_expression %}
  {% endif %}
  {% for post in posts %}
  {% assign posts = posts | append: " " | append: post.path %}
  {% endfor %}
  {% endfor %}
  {% if posts %}
  {% assign posts = posts | split: " " | sort | uniq %}
  {% assign posts = site.posts | where_exp: "post", "posts contains post.path" %}
  {% else %}
  {% assign posts = site.posts %}
  {% endif %}
  {% for post in posts %}
  <li class="post-list-item" data-tags="{{ post.tags | join: " " }}">
    {% if post.cover_url %}
    <div class="post-item-cover" style="background-image: url('{{ post.cover_url }}')"></div>
    {% endif %}
    <div class="post-item-label">
      <a class="post-item-link baseline-fix" href="{{ post.url | relative_url }}" data-date="{{ post.date | date: "%m-%d"  }}">
        {{ post.title | escape }}
      </a>
      {% if post.description %}
      <p class="post-description">{{ post.description }}</p>
      {% endif %}
      <div class="post-item-meta">
        {{ post.date | date: "%B %-d, %Y" }}
        /
        {% capture lang %}{{ post.lang | default: site.lang | default: "en" }}{% endcapture %}
        {% if lang == "en" %}
        {% capture words %}{{ post.content | strip_html | number_of_words  }}{% endcapture %}
        {% else %}
        {% capture words %}{{ post.content | strip_html | size }}{% endcapture %}
        {% endif %}
        {% unless words contains "-" %}
        {{ words | plus: 250 | divided_by: 250 | append: " minute read"  }}
        {% endunless %}
      </div>
    </div>
  </li>
  {% endfor %}
</ul>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-theme-kagami-0.2.0 _layouts/post-list.html