From b5683be19145650c6578e6608c4c0a060e8f0d5d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 17 Jun 2024 15:56:57 +0200 Subject: [PATCH] make multiple fields public --- src/routes/agreements.rs | 8 ++++---- src/routes/api_v1.rs | 2 +- src/routes/blog.rs | 6 +++--- src/routes/contrib.rs | 2 +- src/routes/cours.rs | 2 +- src/routes/cv.rs | 2 +- src/routes/gaming.rs | 2 +- src/routes/index.rs | 2 +- src/routes/memorial.rs | 2 +- src/routes/portfolio.rs | 2 +- src/routes/setup.rs | 2 +- src/routes/web3.rs | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/routes/agreements.rs b/src/routes/agreements.rs index 1854a10..7f66f1f 100644 --- a/src/routes/agreements.rs +++ b/src/routes/agreements.rs @@ -6,7 +6,7 @@ use ramhorns::Content; #[routes] #[get("/.well-known/security.txt")] #[get("/security.txt")] -async fn security(config: web::Data) -> impl Responder { +pub async fn security(config: web::Data) -> impl Responder { HttpResponse::Ok() .content_type(ContentType::plaintext()) .body(build_securitytxt(config.get_ref().to_owned())) @@ -33,7 +33,7 @@ fn build_securitytxt(config: Config) -> String { } #[get("/humans.txt")] -async fn humans(config: web::Data) -> impl Responder { +pub async fn humans(config: web::Data) -> impl Responder { HttpResponse::Ok() .content_type(ContentType::plaintext()) .body(build_humanstxt(config.get_ref().to_owned())) @@ -60,7 +60,7 @@ fn build_humanstxt(config: Config) -> String { } #[get("/robots.txt")] -async fn robots() -> impl Responder { +pub async fn robots() -> impl Responder { HttpResponse::Ok() .content_type(ContentType::plaintext()) .body(build_robotstxt()) @@ -72,7 +72,7 @@ fn build_robotstxt() -> String { } #[get("/app.webmanifest")] -async fn webmanifest(config: web::Data) -> impl Responder { +pub async fn webmanifest(config: web::Data) -> impl Responder { HttpResponse::Ok() .content_type(ContentType("application/manifest+json".parse().unwrap())) .body(build_webmanifest(config.get_ref().to_owned())) diff --git a/src/routes/api_v1.rs b/src/routes/api_v1.rs index 041be22..60daaeb 100644 --- a/src/routes/api_v1.rs +++ b/src/routes/api_v1.rs @@ -8,7 +8,7 @@ struct Info { } #[get("/love")] -async fn love() -> impl Responder { +pub async fn love() -> impl Responder { HttpResponse::Ok().json(Info { unix_epoch: 1_605_576_600, }) diff --git a/src/routes/blog.rs b/src/routes/blog.rs index e975199..252dc72 100644 --- a/src/routes/blog.rs +++ b/src/routes/blog.rs @@ -29,7 +29,7 @@ const BLOG_DIR: &str = "blog"; const POST_DIR: &str = "posts"; #[get("/blog")] -async fn index(config: web::Data) -> impl Responder { +pub async fn index(config: web::Data) -> impl Responder { Html(build_index(config.get_ref().to_owned())) } @@ -190,7 +190,7 @@ struct BlogPostTemplate { } #[get("/blog/p/{id}")] -async fn page(path: web::Path<(String,)>, config: web::Data) -> impl Responder { +pub async fn page(path: web::Path<(String,)>, config: web::Data) -> impl Responder { Html(build_post( &path.into_inner().0, config.get_ref().to_owned(), @@ -281,7 +281,7 @@ fn get_post( #[routes] #[get("/blog/blog.rss")] #[get("/blog/rss")] -async fn rss(config: web::Data) -> impl Responder { +pub async fn rss(config: web::Data) -> impl Responder { HttpResponse::Ok() .content_type(ContentType(MIME_TYPE_RSS.parse().unwrap())) .body(build_rss(config.get_ref().to_owned())) diff --git a/src/routes/contrib.rs b/src/routes/contrib.rs index 7a437af..56184ad 100644 --- a/src/routes/contrib.rs +++ b/src/routes/contrib.rs @@ -13,7 +13,7 @@ use cached::proc_macro::once; use ramhorns::Content; #[get("/contrib")] -async fn page(config: web::Data) -> impl Responder { +pub async fn page(config: web::Data) -> impl Responder { Html(build_page(config.get_ref().to_owned()).await) } diff --git a/src/routes/cours.rs b/src/routes/cours.rs index a3dec8b..93b3291 100644 --- a/src/routes/cours.rs +++ b/src/routes/cours.rs @@ -21,7 +21,7 @@ pub struct PathRequest { } #[get("/cours")] -async fn page(info: web::Query, config: web::Data) -> impl Responder { +pub async fn page(info: web::Query, config: web::Data) -> impl Responder { Html(build_page(&info, config.get_ref().to_owned())) } diff --git a/src/routes/cv.rs b/src/routes/cv.rs index 8720c47..cc03dbf 100644 --- a/src/routes/cv.rs +++ b/src/routes/cv.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/cv")] -async fn page() -> impl Responder { +pub async fn page() -> impl Responder { // Génération du CV depuis un fichier externe TOML ? // Cf. https://github.com/sinaatalay/rendercv // Faudrait une version HTML, et une version PDF diff --git a/src/routes/gaming.rs b/src/routes/gaming.rs index 036b83f..efce9b0 100644 --- a/src/routes/gaming.rs +++ b/src/routes/gaming.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/gaming")] -async fn page() -> impl Responder { +pub async fn page() -> impl Responder { // Liste de mes comptes gaming, de mon setup, de mes configs de jeu, etc. actix_web::web::Redirect::to("/") } diff --git a/src/routes/index.rs b/src/routes/index.rs index f9e7d5b..0f1504e 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -12,7 +12,7 @@ use crate::{ }; #[get("/")] -async fn page(config: web::Data) -> impl Responder { +pub async fn page(config: web::Data) -> impl Responder { Html(build_page(config.get_ref().to_owned())) } diff --git a/src/routes/memorial.rs b/src/routes/memorial.rs index 595f411..2ade9da 100644 --- a/src/routes/memorial.rs +++ b/src/routes/memorial.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/memorial")] -async fn page() -> impl Responder { +pub async fn page() -> impl Responder { // Memorial? J'espere ne jamais faire cette page lol actix_web::web::Redirect::to("/") } diff --git a/src/routes/portfolio.rs b/src/routes/portfolio.rs index 95058b9..afdbffa 100644 --- a/src/routes/portfolio.rs +++ b/src/routes/portfolio.rs @@ -13,7 +13,7 @@ use crate::{ }; #[get("/portfolio")] -async fn page(config: web::Data) -> impl Responder { +pub async fn page(config: web::Data) -> impl Responder { Html(build_page(config.get_ref().to_owned())) } diff --git a/src/routes/setup.rs b/src/routes/setup.rs index dc6bf2a..4a8d1f2 100644 --- a/src/routes/setup.rs +++ b/src/routes/setup.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/setup")] -async fn page() -> impl Responder { +pub async fn page() -> impl Responder { // Explication de l'histoire de par exemple wiki/cat et le follow up // avec les futures video youtube probablement un shortcut // vers un billet de blog diff --git a/src/routes/web3.rs b/src/routes/web3.rs index 8c1ea9b..fc96a45 100644 --- a/src/routes/web3.rs +++ b/src/routes/web3.rs @@ -8,7 +8,7 @@ use crate::{ }; #[get("/web3")] -async fn page(config: web::Data) -> impl Responder { +pub async fn page(config: web::Data) -> impl Responder { Html(build_page(config.get_ref().to_owned())) }