@@ -222,13 +222,16 @@ def handle_deleted_post(
222222 file_path : Path , publication_id : str , headers : Dict [str , str ], results : Dict [str , List [Dict [str , str ]]]
223223) -> None :
224224 """Handle a deleted markdown post file."""
225- metadata , _ = process_markdown (file_path )
226- validate_frontmatter (metadata )
227- post_id = get_post_id (publication_id , metadata ["slug" ], headers )
228- if post_id :
229- success = delete_post (post_id , headers )
230- if success :
231- results ["deleted" ].append ({"slug" : metadata ["slug" ]})
225+ # ToDo: To implement this, we need to get the metadata from this file in the previous commit.abs
226+ # We can use the GitHub API to get the previous commit and then get the file content.
227+ # --GET FILE HERE--
228+ # metadata, _ = process_markdown(file_path)
229+ # validate_frontmatter(metadata)
230+ # post_id = get_post_id(publication_id, metadata["slug"], headers)
231+ # if post_id:
232+ # success = delete_post(post_id, headers)
233+ # if success:
234+ # results["deleted"].append({"slug": metadata["slug"]})
232235 return results
233236
234237
@@ -280,9 +283,10 @@ def main():
280283 file_path , file_path .parent , repo , branch , publication_id , headers , results , added_files
281284 )
282285
283- for file_path in deleted_files :
284- if file_path .is_relative_to (posts_directory ) and file_path .suffix == ".md" :
285- results = handle_deleted_post (file_path , publication_id , headers , results )
286+ # ToDo: To implement this, we need to get the metadata from this file in the previous commit.
287+ # for file_path in deleted_files:
288+ # if file_path.is_relative_to(posts_directory) and file_path.suffix == ".md":
289+ # results = handle_deleted_post(file_path, publication_id, headers, results)
286290
287291 write_results_to_github_output (results )
288292
0 commit comments