Skip to content

Commit dd9d5a7

Browse files
authored
fix: use jsonify to generate valid json (#521)
1 parent d2bbcb7 commit dd9d5a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

assets/js/data/search.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ swcache: true
66
[
77
{% for post in site.posts %}
88
{
9-
"title": "{{ post.title | escape }}",
10-
"url": "{{ post.url | relative_url }}",
11-
"categories": "{{ post.categories | join: ', '}}",
12-
"tags": "{{ post.tags | join: ', ' }}",
9+
"title": {{ post.title | jsonify }},
10+
"url": {{ post.url | relative_url | jsonify }},
11+
"categories": {{ post.categories | join: ', ' | jsonify }},
12+
"tags": {{ post.tags | join: ', ' | jsonify }},
1313
"date": "{{ post.date }}",
1414
{% include no-linenos.html content=post.content %}
15-
"snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | replace: '\', '\\\\' }}"
15+
"snippet": {{ content | strip_html | strip_newlines | jsonify }}
1616
}{% unless forloop.last %},{% endunless %}
1717
{% endfor %}
1818
]

0 commit comments

Comments
 (0)