Skip to content

Commit

Permalink
fix: use jsonify to generate valid json (cotes2020#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakKemble authored and shihtiy-tw committed Nov 26, 2022
1 parent 533ae65 commit cd46383
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions assets/js/data/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ swcache: true
[
{% for post in site.posts %}
{
"title": "{{ post.title | escape }}",
"url": "{{ post.url | relative_url }}",
"categories": "{{ post.categories | join: ', '}}",
"tags": "{{ post.tags | join: ', ' }}",
"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 %}
"snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | replace: '\', '\\\\' }}"
"snippet": {{ content | strip_html | strip_newlines | jsonify }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]

0 comments on commit cd46383

Please sign in to comment.