From 42fd528b22e424f53117ea5af4feef52cec3a2d7 Mon Sep 17 00:00:00 2001 From: dousha Date: Sat, 28 Dec 2024 11:09:12 +0800 Subject: [PATCH] also ensure a blank line at the end of file --- .gitignore | 2 +- convert.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f535e21..b643e99 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /venv/ /output/ - +*.xml diff --git a/convert.py b/convert.py index d815a31..11c1476 100644 --- a/convert.py +++ b/convert.py @@ -42,7 +42,7 @@ for item in items: content = re.sub(r'', '', content) content = re.sub(r'', '

:::more:::

', content) content = '\n'.join([s.strip() for s in content.splitlines() if s.strip()]) - content = md(content).strip() + content = md(content).strip() + '\n' frontmatter = f"---\nlayout: {post_type}\nid: {post_id}\ntitle: \"{title}\"\ncreator: \"{creator}\"\ndate: {date}\ncategories:\n{categories}\ntags:\n{tags}\ndraft: {'yes' if status == 'draft' else 'no'}\n---\n\n" title_slug = slugify(title)