1
0
mirror of https://gitlab.com/Anson-Projects/projects.git synced 2025-09-14 09:35:04 +00:00

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
This commit is contained in:
2025-08-22 11:01:38 -06:00
parent e479c96e44
commit ae1be54f8f

View File

@@ -143,7 +143,7 @@ impl Post {
} }
fn get_slug(link: &str) -> String { 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 { async fn extract_article_content(original_link: &str) -> String {