fix: use jsonify
to generate valid json (#521)
This commit is contained in:
parent
d2bbcb791f
commit
dd9d5a7207
1 changed files with 5 additions and 5 deletions
|
@ -6,13 +6,13 @@ swcache: true
|
||||||
[
|
[
|
||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
{
|
{
|
||||||
"title": "{{ post.title | escape }}",
|
"title": {{ post.title | jsonify }},
|
||||||
"url": "{{ post.url | relative_url }}",
|
"url": {{ post.url | relative_url | jsonify }},
|
||||||
"categories": "{{ post.categories | join: ', '}}",
|
"categories": {{ post.categories | join: ', ' | jsonify }},
|
||||||
"tags": "{{ post.tags | join: ', ' }}",
|
"tags": {{ post.tags | join: ', ' | jsonify }},
|
||||||
"date": "{{ post.date }}",
|
"date": "{{ post.date }}",
|
||||||
{% include no-linenos.html content=post.content %}
|
{% 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 %}
|
}{% unless forloop.last %},{% endunless %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue