fix(feed): remove new lines from summary

This commit is contained in:
curben 2020-01-03 01:30:46 +00:00
parent f05f7ab47b
commit e8b76e3ae9
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
1 changed files with 7 additions and 9 deletions

View File

@ -25,32 +25,30 @@
{% if config.feed.content and post.content %}
<content type="html"><![CDATA[{{ post.content | noControlChars | safe }}]]></content>
{% endif %}
<summary type="html">
{% if post.description %}
{{ post.description }}
<summary type="html">{{ post.description }}</summary>
{% elif post.intro %}
{{ post.intro }}
<summary type="html">{{ post.intro }}</summary>
{% elif post.excerpt %}
{{ post.excerpt }}
<summary type="html">{{ post.excerpt }}</summary>
{% elif post.content %}
{% set short_content = post.content.substring(0, config.feed.content_limit) %}
{% if config.feed.content_limit_delim %}
{% set delim_pos = short_content.lastIndexOf(config.feed.content_limit_delim) %}
{% if delim_pos > -1 %}
{{ short_content.substring(0, delim_pos) }}
<summary type="html">{{ short_content.substring(0, delim_pos) }}</summary>
{% else %}
{{ short_content }}
<summary type="html">{{ short_content }}</summary>
{% endif %}
{% else %}
{{ short_content }}
<summary type="html">{{ short_content }}</summary>
{% endif %}
{% endif %}
</summary>
{% if post.image %}
<content src="{{ url + post.image | uriencode }}" type="image" />
{% endif %}
{% for tag in post.tags.toArray() %}
<category term="{{ tag.name }}" scheme="{{ url + tag.path | uriencode }}"/>
<category term="{{ tag.name }}" scheme="{{ url + tag.path | uriencode }}"/>
{% endfor %}
</entry>
{% endfor %}