From 171b83f2f2a61fd084d8e37bb1ac149409a5f315 Mon Sep 17 00:00:00 2001 From: plain-dev <1149172898@qq.com> Date: Wed, 13 Nov 2019 10:50:10 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=91=98=E8=A6=81=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/_partials/index.swig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layout/_partials/index.swig b/layout/_partials/index.swig index 5c0a28a..38c29c1 100755 --- a/layout/_partials/index.swig +++ b/layout/_partials/index.swig @@ -35,6 +35,9 @@ {% set num = 80 %} {% endif %} {% set content = post.content | striptags %} + {% if post.summary %} + {% set content = post.summary %} + {% endif %} {{ content.substring(0, num) }} {% if content.length > num %}...{% endif %}