1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-19 06:06:54 +00:00

fix: escape special JSON characters in search results (#2481)

Also restore full-text search
This commit is contained in:
Cotes Chung
2025-07-26 20:22:30 +08:00
committed by GitHub
parent 53770e4923
commit 7615d72e93
2 changed files with 23 additions and 21 deletions

View File

@@ -5,16 +5,13 @@ 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 }}",
"content": "{{ description }}"
"date": {{ post.date | jsonify }},
"content": {% include post-description.html json=true %}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]