Fixed RSS item images

This commit is contained in:
Fabio Manganiello 2021-01-26 01:55:46 +01:00
parent 60ab950093
commit 8a62c6a915
1 changed files with 2 additions and 5 deletions

View File

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