From 2a0e12c1c5f3524382245f76d095884062e55b0d Mon Sep 17 00:00:00 2001 From: DeaDvey Date: Tue, 28 Jan 2025 15:26:47 +0000 Subject: [PATCH] rss images --- automations/rss_feed.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/automations/rss_feed.py b/automations/rss_feed.py index fb10c53..e62e5d4 100644 --- a/automations/rss_feed.py +++ b/automations/rss_feed.py @@ -3,23 +3,37 @@ import blogs rss_feed_path = f"{root.path}/rss" 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: content = f''' - DeaDvey + {title} {url} - Linux, tech and reviews + {description} {blogs.blogs_array[0][2]} +0000 {blogs.blogs_array[0][2]} +0000 + + {blog_avatar_url} + {title} + {url} + ''' 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']]>' + content += f''' {blogs.blogs_array[current_blog][0]} https://deadvey.com/blog/{current_blog}.html - {blogs.blogs_array[current_blog][1]} + {blogs.blogs_array[current_blog][1]}{images_div} {blogs.blogs_array[current_blog][2]} +0000 '''