diff --git a/src/main.rs b/src/main.rs index 3b8b0f2..56d2d5b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use crate::routes::{ mod config; mod template; -mod misc; +mod utils; mod routes; #[actix_web::main] diff --git a/src/routes/agreements.rs b/src/routes/agreements.rs index 7f66f1f..0e05bb8 100644 --- a/src/routes/agreements.rs +++ b/src/routes/agreements.rs @@ -1,4 +1,4 @@ -use crate::{config::Config, misc::utils::get_url, template::InfosPage}; +use crate::{config::Config, utils::utils::get_url, template::InfosPage}; use actix_web::{get, http::header::ContentType, routes, web, HttpResponse, Responder}; use cached::proc_macro::once; use ramhorns::Content; diff --git a/src/routes/blog.rs b/src/routes/blog.rs index 252dc72..5235e99 100644 --- a/src/routes/blog.rs +++ b/src/routes/blog.rs @@ -16,7 +16,7 @@ use ramhorns::Content; use crate::{ config::Config, - misc::{ + utils::{ date::Date, markdown::{get_metadata, get_options, File, FileMetadataBlog, TypeFileMetadata}, utils::{get_url, make_kw, read_file, Html}, diff --git a/src/routes/contact.rs b/src/routes/contact.rs index e930bf3..318db41 100644 --- a/src/routes/contact.rs +++ b/src/routes/contact.rs @@ -6,7 +6,7 @@ use std::fs::read_to_string; use crate::{ config::Config, - misc::{ + utils::{ markdown::{File, TypeFileMetadata}, utils::{make_kw, read_file, Html}, }, diff --git a/src/routes/contrib.rs b/src/routes/contrib.rs index 56184ad..319b5bc 100644 --- a/src/routes/contrib.rs +++ b/src/routes/contrib.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use crate::{ config::Config, - misc::{ + utils::{ github::{fetch_pr, ProjectState}, utils::{make_kw, Html}, }, diff --git a/src/routes/cours.rs b/src/routes/cours.rs index 3464930..35fc87f 100644 --- a/src/routes/cours.rs +++ b/src/routes/cours.rs @@ -8,11 +8,11 @@ use serde::{Deserialize, Serialize}; use crate::{ config::Config, - misc::{ + template::{InfosPage, NavBar}, + utils::{ markdown::{File, TypeFileMetadata}, utils::{make_kw, read_file, Html}, }, - template::{InfosPage, NavBar}, }; #[derive(Debug, Deserialize)] diff --git a/src/routes/index.rs b/src/routes/index.rs index 0f1504e..71264e1 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -4,7 +4,7 @@ use ramhorns::Content; use crate::{ config::Config, - misc::{ + utils::{ markdown::{File, TypeFileMetadata}, utils::{make_kw, read_file, Html}, }, diff --git a/src/routes/not_found.rs b/src/routes/not_found.rs index fc84c1c..f1b390a 100644 --- a/src/routes/not_found.rs +++ b/src/routes/not_found.rs @@ -4,7 +4,7 @@ use ramhorns::Content; use crate::{ config::Config, - misc::utils::{get_url, Html}, + utils::utils::{get_url, Html}, template::{InfosPage, NavBar}, }; diff --git a/src/routes/portfolio.rs b/src/routes/portfolio.rs index afdbffa..43fd492 100644 --- a/src/routes/portfolio.rs +++ b/src/routes/portfolio.rs @@ -5,7 +5,7 @@ use ramhorns::Content; use crate::{ config::Config, - misc::{ + utils::{ markdown::{File, TypeFileMetadata}, utils::{make_kw, read_file, Html}, }, diff --git a/src/routes/web3.rs b/src/routes/web3.rs index fc96a45..8dbe3af 100644 --- a/src/routes/web3.rs +++ b/src/routes/web3.rs @@ -3,7 +3,7 @@ use cached::proc_macro::once; use crate::{ config::Config, - misc::utils::{make_kw, Html}, + utils::utils::{make_kw, Html}, template::InfosPage, }; diff --git a/src/misc/date.rs b/src/utils/date.rs similarity index 100% rename from src/misc/date.rs rename to src/utils/date.rs diff --git a/src/misc/github.rs b/src/utils/github.rs similarity index 97% rename from src/misc/github.rs rename to src/utils/github.rs index 1210b84..175a151 100644 --- a/src/misc/github.rs +++ b/src/utils/github.rs @@ -1,7 +1,7 @@ use reqwest::{header::ACCEPT, Error}; use serde::Deserialize; -use crate::misc::utils::get_reqwest_client; +use crate::utils::utils::get_reqwest_client; #[derive(Debug, Deserialize)] struct GithubResponse { diff --git a/src/misc/markdown.rs b/src/utils/markdown.rs similarity index 99% rename from src/misc/markdown.rs rename to src/utils/markdown.rs index 50fab1b..a539f0f 100644 --- a/src/misc/markdown.rs +++ b/src/utils/markdown.rs @@ -1,4 +1,4 @@ -use crate::misc::date::Date; +use crate::utils::date::Date; use base64::engine::general_purpose; use base64::Engine; use comrak::nodes::{AstNode, NodeValue}; diff --git a/src/misc/mod.rs b/src/utils/mod.rs similarity index 100% rename from src/misc/mod.rs rename to src/utils/mod.rs diff --git a/src/misc/utils.rs b/src/utils/utils.rs similarity index 100% rename from src/misc/utils.rs rename to src/utils/utils.rs