1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 13:44:15 +00:00

Code improvement.

Passing parameters to includes
This commit is contained in:
Cotes Chung
2020-07-22 21:41:49 +08:00
parent 562fcd4fd8
commit 209058b84a
7 changed files with 28 additions and 24 deletions

View File

@@ -10,9 +10,8 @@ layout: compress
"categories": "{{ post.categories | join: ', '}}",
"tags": "{{ post.tags | join: ', ' }}",
"date": "{{ post.date }}",
{% assign _content = post.content %}
{% include no-linenos.html %}
"snippet": "{{ _content | strip_html | strip_newlines | remove_chars | escape | truncate: 300 | replace: '\', '\\\\' }}"
{% include no-linenos.html content=post.content %}
"snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | truncate: 300 | replace: '\', '\\\\' }}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]