finalised the rss blog creation system
This commit is contained in:
parent
9948cd85ae
commit
808bf6f8d3
BIN
.parse_post.py.swo
Normal file
BIN
.parse_post.py.swo
Normal file
Binary file not shown.
@ -9,19 +9,23 @@ def create_rss():
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title>{config.site_name}</title>
|
||||
<link>{config.site_url}</title>
|
||||
<link>{config.site_url}</link>
|
||||
<description>{config.site_description}</description>
|
||||
<pubDate>{datetime.now().strftime("%a, %d %b %Y %H:%M:%S %z")}</pubDate>
|
||||
<lastBuildDate>{datetime.now().strftime("%a, %d %b %Y %H:%M:%S %z")}</lastBuildDate>
|
||||
'''
|
||||
for current_post_index in range(len(posts.posts)):
|
||||
for current_post_index in range(len(posts.posts)-1,-1,-1):
|
||||
file_content += f'''
|
||||
<item>
|
||||
<title>{posts.posts[current_post_index]["title"]}</title>
|
||||
<link>{config.site_url}/post/{current_post_index}.{config.file_extension}</link>
|
||||
<description>{posts.posts[current_post_index]["content"]}</descriptiont>
|
||||
<pubDate>{posts.posts[current_post_index]["pubdate"]}</pubDate>
|
||||
<editDate>{posts.posts[current_post_index]["editdate"]}</editDate>
|
||||
<description>{posts.posts[current_post_index]["content"]}</description>
|
||||
<pubDate>
|
||||
{datetime.strptime(posts.posts[current_post_index]["pubdate"],"%d%m%YZ%H%M%ST").strftime("%a, %d %b %Y %H:%M:%S %z")}
|
||||
</pubDate>
|
||||
<editDate>
|
||||
{datetime.strptime(posts.posts[current_post_index]["editdate"],"%d%m%YZ%H%M%ST").strftime("%a, %d %b %Y %H:%M:%S %z")}
|
||||
</editDate>
|
||||
</item>'''
|
||||
file_content += '''
|
||||
</channel>
|
||||
|
Loading…
x
Reference in New Issue
Block a user