~xdavidwu/xdavidwu.link

f7a1ac1c54c6fdb0e085e209f2c564d32cdf8f60 — xdavidwu 2 years ago e0fff9a
archive: truncate desc more on grid
1 files changed, 7 insertions(+), 1 deletions(-)

M _includes/archive-single.html
M _includes/archive-single.html => _includes/archive-single.html +7 -1
@@ 10,6 10,12 @@
  {% assign title = post.title %}
{% endif %}

{% if include.type == "grid" %}
  {% assign desc_truncate = 100 %}
{% else %}
  {% assign desc_truncate = 160 %}
{% endif %}

<div class="{{ include.type | default: 'list' }}__item">
  <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
    {% if include.type == "grid" and teaser %}


@@ 25,6 31,6 @@
      {% endif %}
    </h2>
    {% include page__meta.html type=include.type %}
    {% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify | strip_html | truncate: 160 }}</p>{% endif %}
    {% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify | strip_html | truncate: desc_truncate }}</p>{% endif %}
  </article>
</div>