Skip to content

Commit

Permalink
perf: truncate post content for search results
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Oct 21, 2022
1 parent 1c330f4 commit 647eea8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/data/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
]

0 comments on commit 647eea8

Please sign in to comment.