Skip to content

Commit f09cdc4

Browse files
committed
fix: remove fetch to external blog
1 parent 27e0b34 commit f09cdc4

File tree

4 files changed

+1
-170
lines changed

4 files changed

+1
-170
lines changed

src/main.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use pages::{
2424
};
2525
use ssg::Ssg;
2626
use tokio::sync::RwLock;
27-
use utils::{fetch_dev_to::fetch_dev_to, fetch_hashnode::fetch_hashnode, generate_feed_rss};
27+
use utils::generate_feed_rss;
2828

2929
use crate::pages::{article_page::ArticlePage, home::Homepage};
3030

@@ -186,25 +186,6 @@ async fn list_articles() -> Result<Vec<Article>, Box<dyn std::error::Error>> {
186186
let esta_semana_en_rust_folder = fs::read_dir("./esta_semana_en_rust")?;
187187
articles.append(&mut posts_from_folder(esta_semana_en_rust_folder)?);
188188

189-
if !cfg!(debug_assertions) {
190-
let dev_to_articles = fetch_dev_to().await?;
191-
let hashnode_articles = fetch_hashnode().await?;
192-
193-
articles.append(
194-
&mut dev_to_articles
195-
.into_iter()
196-
.map(Article::from)
197-
.collect::<Vec<Article>>(),
198-
);
199-
200-
articles.append(
201-
&mut hashnode_articles
202-
.into_iter()
203-
.map(Article::from)
204-
.collect::<Vec<Article>>(),
205-
);
206-
}
207-
208189
articles.sort_by(|a, b| b.date.cmp(&a.date));
209190

210191
Ok(articles)

src/utils/fetch_dev_to.rs

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/utils/fetch_hashnode.rs

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/utils/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ use rss::{validation::Validate, Category, ChannelBuilder, Item};
44

55
use crate::models::article::Article;
66

7-
pub mod fetch_dev_to;
8-
pub mod fetch_hashnode;
9-
107
pub fn generate_feed_rss(
118
articles: &[Article],
129
out_file: &str,

0 commit comments

Comments
 (0)