1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

fix(search): avoid missing spaces between paragraphs in search results (#2199)

- Use a common post-snippet for search results to avoid line break issues
- Reduce Jekyll include files to speed up the build
- Remove outdated key from search.json
This commit is contained in:
Cotes Chung
2025-01-20 21:15:51 +08:00
parent e44c048aef
commit 0eb7efa7f5
4 changed files with 16 additions and 17 deletions

View File

@@ -5,16 +5,16 @@ swcache: true
[
{% for post in site.posts %}
{%- capture description -%}
{% include post-description.html %}
{%- endcapture -%}
{
"title": {{ post.title | jsonify }},
"url": {{ post.url | relative_url | jsonify }},
"categories": {{ post.categories | join: ', ' | jsonify }},
"tags": {{ post.tags | join: ', ' | jsonify }},
"date": "{{ post.date }}",
{% include no-linenos.html content=post.content %}
{% assign _content = content | strip_html | strip_newlines %}
"snippet": {{ _content | truncate: 200 | jsonify }},
"content": {{ _content | jsonify }}
"content": "{{ description }}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]