Skip to content

Commit

Permalink
fix: remove fetch to external blog
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed May 21, 2024
1 parent 27e0b34 commit f09cdc4
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 170 deletions.
21 changes: 1 addition & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use pages::{
};
use ssg::Ssg;
use tokio::sync::RwLock;
use utils::{fetch_dev_to::fetch_dev_to, fetch_hashnode::fetch_hashnode, generate_feed_rss};
use utils::generate_feed_rss;

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

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

if !cfg!(debug_assertions) {
let dev_to_articles = fetch_dev_to().await?;
let hashnode_articles = fetch_hashnode().await?;

articles.append(
&mut dev_to_articles
.into_iter()
.map(Article::from)
.collect::<Vec<Article>>(),
);

articles.append(
&mut hashnode_articles
.into_iter()
.map(Article::from)
.collect::<Vec<Article>>(),
);
}

articles.sort_by(|a, b| b.date.cmp(&a.date));

Ok(articles)
Expand Down
73 changes: 0 additions & 73 deletions src/utils/fetch_dev_to.rs

This file was deleted.

74 changes: 0 additions & 74 deletions src/utils/fetch_hashnode.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ use rss::{validation::Validate, Category, ChannelBuilder, Item};

use crate::models::article::Article;

pub mod fetch_dev_to;
pub mod fetch_hashnode;

pub fn generate_feed_rss(
articles: &[Article],
out_file: &str,
Expand Down

0 comments on commit f09cdc4

Please sign in to comment.