diff --git a/.github/workflows/generator.py b/.github/workflows/generator.py index 8cfa25f..c8636b4 100644 --- a/.github/workflows/generator.py +++ b/.github/workflows/generator.py @@ -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) diff --git a/content/generated/metas.json b/content/generated/metas.json index f824a9b..d274f3d 100644 --- a/content/generated/metas.json +++ b/content/generated/metas.json @@ -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"} ] \ No newline at end of file diff --git a/content/images/2021-10-14 Clive Wearing journal.png b/content/images/2021-10-14 Clive Wearing journal.png index 18ae1bd..657ab72 100644 Binary files a/content/images/2021-10-14 Clive Wearing journal.png and b/content/images/2021-10-14 Clive Wearing journal.png differ