From f7a1ac1c54c6fdb0e085e209f2c564d32cdf8f60 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Wed, 26 May 2021 23:06:40 +0800 Subject: [PATCH] archive: truncate desc more on grid --- _includes/archive-single.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/_includes/archive-single.html b/_includes/archive-single.html index 6817480..969f1f1 100644 --- a/_includes/archive-single.html +++ b/_includes/archive-single.html @@ -10,6 +10,12 @@ {% assign title = post.title %} {% endif %} +{% if include.type == "grid" %} + {% assign desc_truncate = 100 %} +{% else %} + {% assign desc_truncate = 160 %} +{% endif %} +
{% if include.type == "grid" and teaser %} @@ -25,6 +31,6 @@ {% endif %} {% include page__meta.html type=include.type %} - {% if post.excerpt %}

{{ post.excerpt | markdownify | strip_html | truncate: 160 }}

{% endif %} + {% if post.excerpt %}

{{ post.excerpt | markdownify | strip_html | truncate: desc_truncate }}

{% endif %}
-- 2.43.0