From 8701c17d63560720a356283274c0ed010d9b1d8e Mon Sep 17 00:00:00 2001 From: liraymond04 Date: Thu, 12 Dec 2024 00:40:52 -0800 Subject: [PATCH] Change convert script to save project markdown files to index.md --- .github/workflows/update-buckets.yml | 1 + .github/workflows/update-supabase.yml | 1 + .../{Stand by me Pleiades Part 4.md => index.md} | 2 +- scripts/convert.py | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) rename posts/side_stories/Stand by me Pleiades Part 4/{Stand by me Pleiades Part 4.md => index.md} (99%) diff --git a/.github/workflows/update-buckets.yml b/.github/workflows/update-buckets.yml index 3fa8cdf..1442e23 100644 --- a/.github/workflows/update-buckets.yml +++ b/.github/workflows/update-buckets.yml @@ -30,6 +30,7 @@ jobs: with: recover_deleted_files: true recover_deleted_files_to_destination: 'actions/recovered' + output_renamed_files_as_deleted_and_added: true separator: "," files: | **/*.png diff --git a/.github/workflows/update-supabase.yml b/.github/workflows/update-supabase.yml index 69bbe43..0fb68a8 100644 --- a/.github/workflows/update-supabase.yml +++ b/.github/workflows/update-supabase.yml @@ -29,6 +29,7 @@ jobs: with: recover_deleted_files: true recover_deleted_files_to_destination: 'actions/recovered' + output_renamed_files_as_deleted_and_added: true separator: "," files: | **/*.md diff --git a/posts/side_stories/Stand by me Pleiades Part 4/Stand by me Pleiades Part 4.md b/posts/side_stories/Stand by me Pleiades Part 4/index.md similarity index 99% rename from posts/side_stories/Stand by me Pleiades Part 4/Stand by me Pleiades Part 4.md rename to posts/side_stories/Stand by me Pleiades Part 4/index.md index 59baf29..c05604f 100644 --- a/posts/side_stories/Stand by me Pleiades Part 4/Stand by me Pleiades Part 4.md +++ b/posts/side_stories/Stand by me Pleiades Part 4/index.md @@ -2,7 +2,7 @@ layout: webnovel title: Stand by me Pleiades Part 4 repo_url: liraymond04/re0-translations -file_path: posts/side_stories/Stand by me Pleiades Part 4/Stand by me Pleiades Part 4.md +file_path: posts/side_stories/Stand by me Pleiades Part 4/index.md supabase_page_format: true media_files: ['posts/side_stories/Stand by me Pleiades Part 4/media/image1.png', 'posts/side_stories/Stand by me Pleiades Part 4/media/image2.png'] --- diff --git a/scripts/convert.py b/scripts/convert.py index b870bf3..b1a0331 100644 --- a/scripts/convert.py +++ b/scripts/convert.py @@ -10,7 +10,7 @@ cur_dir = os.getcwd() def generate_yaml_frontmatter(md_file_path, media_files): - title = os.path.splitext(os.path.basename(md_file_path))[0] + title = os.path.split(os.path.dirname(md_file_path))[1] file_path = os.path.relpath(md_file_path, start=cur_dir) @@ -82,7 +82,7 @@ def process_directories(root_dir, output_dir, lua_filter=None): os.makedirs(output_file_dir, exist_ok=True) - output_file = os.path.join(output_file_dir, target_file.replace('.docx', '.md')) + output_file = os.path.join(output_file_dir, "index.md") convert_docx_to_md(input_file, output_file, output_file_dir, lua_filter) else: