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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user