From 647eea8dbd716f9d3cb8330c3139fa753903f51d Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 22 Oct 2022 03:33:09 +0800 Subject: [PATCH] perf: truncate post content for search results --- assets/js/data/search.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/data/search.json b/assets/js/data/search.json index 5192c9f..1a766d9 100644 --- a/assets/js/data/search.json +++ b/assets/js/data/search.json @@ -12,7 +12,7 @@ swcache: true "tags": {{ post.tags | join: ', ' | jsonify }}, "date": "{{ post.date }}", {% include no-linenos.html content=post.content %} - "snippet": {{ content | strip_html | strip_newlines | jsonify }} + "snippet": {{ content | strip_html | strip_newlines | truncate: 200 | jsonify }} }{% unless forloop.last %},{% endunless %} {% endfor %} ]