rss images
This commit is contained in:
parent
f4affac412
commit
2a0e12c1c5
@ -3,23 +3,37 @@ import blogs
|
|||||||
|
|
||||||
rss_feed_path = f"{root.path}/rss"
|
rss_feed_path = f"{root.path}/rss"
|
||||||
url = "https://deadvey.com"
|
url = "https://deadvey.com"
|
||||||
|
images_path = f"{url}/images"
|
||||||
|
title = "DeaDvey's Blog"
|
||||||
|
blog_avatar_url = "{url}/images/pfp6.png"
|
||||||
|
description = "Linux, tech and film reviews"
|
||||||
|
|
||||||
with open(rss_feed_path, "w") as rss_file:
|
with open(rss_feed_path, "w") as rss_file:
|
||||||
content = f'''<?xml version="1.0" encoding="UTF-8" ?>
|
content = f'''<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<rss version="2.0">
|
<rss version="2.0">
|
||||||
<channel>
|
<channel>
|
||||||
<title>DeaDvey</title>
|
<title>{title}</title>
|
||||||
<link>{url}</link>
|
<link>{url}</link>
|
||||||
<description>Linux, tech and reviews</description>
|
<description>{description}</description>
|
||||||
<pubDate>{blogs.blogs_array[0][2]} +0000</pubDate>
|
<pubDate>{blogs.blogs_array[0][2]} +0000</pubDate>
|
||||||
<lastBuildDate>{blogs.blogs_array[0][2]} +0000</lastBuildDate>
|
<lastBuildDate>{blogs.blogs_array[0][2]} +0000</lastBuildDate>
|
||||||
|
<image>
|
||||||
|
<url>{blog_avatar_url}</url>
|
||||||
|
<title>{title}</title>
|
||||||
|
<link>{url}</link>
|
||||||
|
</image>
|
||||||
'''
|
'''
|
||||||
for current_blog in range(len(blogs.blogs_array)-1,0,-1):
|
for current_blog in range(len(blogs.blogs_array)-1,0,-1):
|
||||||
|
# Add images to feed item
|
||||||
|
images_div = ""
|
||||||
|
for i in blogs.blogs_array[current_blog][3]:
|
||||||
|
images_div += f'<![CDATA[<img src="{images_path}/{i}"/>]]>'
|
||||||
|
|
||||||
content += f'''
|
content += f'''
|
||||||
<item>
|
<item>
|
||||||
<title>{blogs.blogs_array[current_blog][0]}</title>
|
<title>{blogs.blogs_array[current_blog][0]}</title>
|
||||||
<link>https://deadvey.com/blog/{current_blog}.html</link>
|
<link>https://deadvey.com/blog/{current_blog}.html</link>
|
||||||
<description>{blogs.blogs_array[current_blog][1]}</description>
|
<description>{blogs.blogs_array[current_blog][1]}{images_div}</description>
|
||||||
<pubDate>{blogs.blogs_array[current_blog][2]} +0000</pubDate>
|
<pubDate>{blogs.blogs_array[current_blog][2]} +0000</pubDate>
|
||||||
</item>
|
</item>
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user