Skip to content

Commit

Permalink
add:新增指定文章摘要内容
Browse files Browse the repository at this point in the history
  • Loading branch information
olyvcn authored and xzhih committed Nov 13, 2019
1 parent 9293bf1 commit 171b83f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions layout/_partials/index.swig
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
</p>
Expand Down

0 comments on commit 171b83f

Please sign in to comment.