[F] Fix image paths

This commit is contained in:
Hykilpikonna
2021-12-26 11:08:04 -05:00
parent a3011715d2
commit f81994dd56
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -21,6 +21,7 @@ if __name__ == '__main__':
if not b.endswith('.md'):
continue
# Read blog posts
file = 'content/posts/' + b
with open(file, 'r', encoding='utf-8') as f:
md = f.read().strip()
@@ -38,8 +39,9 @@ if __name__ == '__main__':
except:
pass
# Convert image path
if 'title_image' in meta and '/' not in meta['title_image']:
meta['title_image'] = 'content/generated/' + meta['title_image']
meta['title_image'] = 'content/images/' + meta['title_image']
metas.sort(key=lambda x: x['date'], reverse=True)
+2 -2
View File
@@ -1,5 +1,5 @@
[
{"title": "一个测试文稿", "subtitle": "你好,世界", "tags": ["测试", "测试2"], "file": "content/posts/2021-12-25 Test Post.md", "date": "2021-12-25"},
{"title": "651层", "title_image": "content/generated/2021-12-07 earth.jpg", "tags": ["梦"], "file": "content/posts/2021-12-07 651层.md", "date": "2021-12-07"},
{"title": "十五秒的记忆、开心又无意义的人生、人的自私愿望", "title_image": "content/generated/2021-10-14 Clive Wearing journal.png", "tags": ["心理"], "file": "content/posts/2021-10-14 十五秒的记忆.md", "date": "2021-10-14"}
{"title": "651层", "title_image": "content/images/2021-12-07 earth.jpg", "tags": ["梦"], "file": "content/posts/2021-12-07 651层.md", "date": "2021-12-07"},
{"title": "十五秒的记忆、开心又无意义的人生、人的自私愿望", "title_image": "content/images/2021-10-14 Clive Wearing journal.png", "tags": ["心理"], "file": "content/posts/2021-10-14 十五秒的记忆.md", "date": "2021-10-14"}
]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 KiB

After

Width:  |  Height:  |  Size: 392 KiB