Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fetch to external blog #49

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading