[+] OKP day 2

This commit is contained in:
Hykilpikonna
2023-03-16 09:43:14 -04:00
parent e4135584bc
commit c68def3373
7 changed files with 33 additions and 0 deletions
+4
View File
@@ -50,6 +50,10 @@ if __name__ == '__main__':
post['content'] = md.strip()
# Process iamges
post['content'] = re.sub(r'!\[\[\.\/(.*)\|(.*)\]\]', r'<figure><img src="{src}/content/posts/\1" /><caption>\2</caption></figure>', post['content'])
post['content'] = re.sub(r'!\[\[(.*)\|(.*)\]\]', r'<figure><img src="{src}/content/images/\1" /><caption>\2</caption></figure>', post['content'])
posts.sort(key=lambda x: x['date'], reverse=True)
# Give every post an id based on index