Skip to content

Commit

Permalink
fix: use jsonify to generate valid json (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakKemble authored Mar 3, 2022
1 parent d2bbcb7 commit dd9d5a7
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 dd9d5a7

Please sign in to comment.