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,27 +25,25 @@
{% if config.feed.content and post.content %} {% if config.feed.content and post.content %}
<content type="html"><![CDATA[{{ post.content | noControlChars | safe }}]]></content> <content type="html"><![CDATA[{{ post.content | noControlChars | safe }}]]></content>
{% endif %} {% endif %}
<summary type="html">
{% if post.description %} {% if post.description %}
{{ post.description }} <summary type="html">{{ post.description }}</summary>
{% elif post.intro %} {% elif post.intro %}
{{ post.intro }} <summary type="html">{{ post.intro }}</summary>
{% elif post.excerpt %} {% elif post.excerpt %}
{{ post.excerpt }} <summary type="html">{{ post.excerpt }}</summary>
{% elif post.content %} {% elif post.content %}
{% set short_content = post.content.substring(0, config.feed.content_limit) %} {% set short_content = post.content.substring(0, config.feed.content_limit) %}
{% if config.feed.content_limit_delim %} {% if config.feed.content_limit_delim %}
{% set delim_pos = short_content.lastIndexOf(config.feed.content_limit_delim) %} {% set delim_pos = short_content.lastIndexOf(config.feed.content_limit_delim) %}
{% if delim_pos > -1 %} {% if delim_pos > -1 %}
{{ short_content.substring(0, delim_pos) }} <summary type="html">{{ short_content.substring(0, delim_pos) }}</summary>
{% else %} {% else %}
{{ short_content }} <summary type="html">{{ short_content }}</summary>
{% endif %} {% endif %}
{% else %} {% else %}
{{ short_content }} <summary type="html">{{ short_content }}</summary>
{% endif %} {% endif %}
{% endif %} {% endif %}
</summary>
{% if post.image %} {% if post.image %}
<content src="{{ url + post.image | uriencode }}" type="image" /> <content src="{{ url + post.image | uriencode }}" type="image" />
{% endif %} {% endif %}