1
0
Fork 0

re-add fixed rss feed with read more

This commit is contained in:
Harald Hoyer 2023-11-06 13:12:40 +01:00
parent 1cea7e08e2
commit 81b232fa91

40
templates/rss.xml Normal file
View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>{{ config.title }}
{%- if term %} - {{ term.name }}
{%- elif section.title %} - {{ section.title }}
{%- endif -%}
</title>
<link>
{%- if section -%}
{{ section.permalink | escape_xml | safe }}
{%- else -%}
{{ config.base_url | escape_xml | safe }}
{%- endif -%}
</link>
<description>{{ config.description }}</description>
<generator>Zola</generator>
<language>{{ lang }}</language>
<atom:link href="{{ feed_url | safe }}" rel="self" type="application/rss+xml"/>
<lastBuildDate>{{ last_updated | date(format="%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate>
{%- for page in pages %}
<item>
<title>{{ page.title }}</title>
<pubDate>{{ page.date | date(format="%a, %d %b %Y %H:%M:%S %z") }}</pubDate>
<author>
{%- if page.authors -%}
{{ page.authors[0] }}
{%- elif config.author -%}
{{ config.author }}
{%- else -%}
Unknown
{%- endif -%}
</author>
<link>{{ page.permalink | escape_xml | safe }}</link>
<guid>{{ page.permalink | escape_xml | safe }}</guid>
<description>{% if page.summary %}{{ page.summary }} {{ '<p class="post-meta"><a href="' | escape_xml | safe }}{{ page.permalink }}{{ '">Read More</a></p>' | escape_xml | safe }} {% else %}{{ page.content }}{% endif %}</description>
</item>
{%- endfor %}
</channel>
</rss>