From ae1be54f8fac27fadba5c88cc107970a4a7e3888 Mon Sep 17 00:00:00 2001 From: Anson Date: Fri, 22 Aug 2025 11:01:38 -0600 Subject: [PATCH] fix: remove trailing slash from slugs to fix Ghost API lookup - Strip trailing slashes from slugs in get_slug() function - This prevents double slashes in the Ghost API URL which was causing get_existing_post_id() to fail and create duplicate posts --- ghost-upload/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost-upload/src/main.rs b/ghost-upload/src/main.rs index 2a455ec..bd07b09 100644 --- a/ghost-upload/src/main.rs +++ b/ghost-upload/src/main.rs @@ -143,7 +143,7 @@ impl Post { } fn get_slug(link: &str) -> String { - link.split_once("/posts/").unwrap().1.to_string() + link.split_once("/posts/").unwrap().1.trim_end_matches('/').to_string() } async fn extract_article_content(original_link: &str) -> String {