Fixed RSS item images

This commit is contained in:
Fabio Manganiello 2021-01-26 01:55:46 +01:00
parent 60ab950093
commit 8a62c6a915

View file

@ -107,7 +107,7 @@ def rss_route():
pages = get_pages(with_content=True)
return Response('''<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/>
<channel>
<title>Platypush blog feeds</title>
<link>http://blog.platypush.tech</link>
@ -132,15 +132,12 @@ def rss_route():
<link>https://blog.platypush.tech{link}</link>
<pubDate>{published}</pubDate>
<description><![CDATA[{content}]]></description>
<image>
<url>https://blog.platypush.tech/img{image}</url>
</image>
<media:content medium="image" url="https://blog.platypush.tech/img{image}" width="200" height="150" />
</item>
'''.format(
title=page.get('title', '[No Title]'),
link=page.get('uri', ''),
published=page['published'].strftime('%a, %d %b %Y %H:%M:%S GMT') if 'published' in page else '',
# description=page.get('description', ''),
content=page.get('content', ''),
image=page.get('image', ''),
)