make multiple fields public
This commit is contained in:
parent
9010c7f975
commit
b5683be191
12 changed files with 17 additions and 17 deletions
|
@ -6,7 +6,7 @@ use ramhorns::Content;
|
||||||
#[routes]
|
#[routes]
|
||||||
#[get("/.well-known/security.txt")]
|
#[get("/.well-known/security.txt")]
|
||||||
#[get("/security.txt")]
|
#[get("/security.txt")]
|
||||||
async fn security(config: web::Data<Config>) -> impl Responder {
|
pub async fn security(config: web::Data<Config>) -> impl Responder {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
.content_type(ContentType::plaintext())
|
.content_type(ContentType::plaintext())
|
||||||
.body(build_securitytxt(config.get_ref().to_owned()))
|
.body(build_securitytxt(config.get_ref().to_owned()))
|
||||||
|
@ -33,7 +33,7 @@ fn build_securitytxt(config: Config) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/humans.txt")]
|
#[get("/humans.txt")]
|
||||||
async fn humans(config: web::Data<Config>) -> impl Responder {
|
pub async fn humans(config: web::Data<Config>) -> impl Responder {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
.content_type(ContentType::plaintext())
|
.content_type(ContentType::plaintext())
|
||||||
.body(build_humanstxt(config.get_ref().to_owned()))
|
.body(build_humanstxt(config.get_ref().to_owned()))
|
||||||
|
@ -60,7 +60,7 @@ fn build_humanstxt(config: Config) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/robots.txt")]
|
#[get("/robots.txt")]
|
||||||
async fn robots() -> impl Responder {
|
pub async fn robots() -> impl Responder {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
.content_type(ContentType::plaintext())
|
.content_type(ContentType::plaintext())
|
||||||
.body(build_robotstxt())
|
.body(build_robotstxt())
|
||||||
|
@ -72,7 +72,7 @@ fn build_robotstxt() -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/app.webmanifest")]
|
#[get("/app.webmanifest")]
|
||||||
async fn webmanifest(config: web::Data<Config>) -> impl Responder {
|
pub async fn webmanifest(config: web::Data<Config>) -> impl Responder {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
.content_type(ContentType("application/manifest+json".parse().unwrap()))
|
.content_type(ContentType("application/manifest+json".parse().unwrap()))
|
||||||
.body(build_webmanifest(config.get_ref().to_owned()))
|
.body(build_webmanifest(config.get_ref().to_owned()))
|
||||||
|
|
|
@ -8,7 +8,7 @@ struct Info {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/love")]
|
#[get("/love")]
|
||||||
async fn love() -> impl Responder {
|
pub async fn love() -> impl Responder {
|
||||||
HttpResponse::Ok().json(Info {
|
HttpResponse::Ok().json(Info {
|
||||||
unix_epoch: 1_605_576_600,
|
unix_epoch: 1_605_576_600,
|
||||||
})
|
})
|
||||||
|
|
|
@ -29,7 +29,7 @@ const BLOG_DIR: &str = "blog";
|
||||||
const POST_DIR: &str = "posts";
|
const POST_DIR: &str = "posts";
|
||||||
|
|
||||||
#[get("/blog")]
|
#[get("/blog")]
|
||||||
async fn index(config: web::Data<Config>) -> impl Responder {
|
pub async fn index(config: web::Data<Config>) -> impl Responder {
|
||||||
Html(build_index(config.get_ref().to_owned()))
|
Html(build_index(config.get_ref().to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ struct BlogPostTemplate {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/blog/p/{id}")]
|
#[get("/blog/p/{id}")]
|
||||||
async fn page(path: web::Path<(String,)>, config: web::Data<Config>) -> impl Responder {
|
pub async fn page(path: web::Path<(String,)>, config: web::Data<Config>) -> impl Responder {
|
||||||
Html(build_post(
|
Html(build_post(
|
||||||
&path.into_inner().0,
|
&path.into_inner().0,
|
||||||
config.get_ref().to_owned(),
|
config.get_ref().to_owned(),
|
||||||
|
@ -281,7 +281,7 @@ fn get_post(
|
||||||
#[routes]
|
#[routes]
|
||||||
#[get("/blog/blog.rss")]
|
#[get("/blog/blog.rss")]
|
||||||
#[get("/blog/rss")]
|
#[get("/blog/rss")]
|
||||||
async fn rss(config: web::Data<Config>) -> impl Responder {
|
pub async fn rss(config: web::Data<Config>) -> impl Responder {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
.content_type(ContentType(MIME_TYPE_RSS.parse().unwrap()))
|
.content_type(ContentType(MIME_TYPE_RSS.parse().unwrap()))
|
||||||
.body(build_rss(config.get_ref().to_owned()))
|
.body(build_rss(config.get_ref().to_owned()))
|
||||||
|
|
|
@ -13,7 +13,7 @@ use cached::proc_macro::once;
|
||||||
use ramhorns::Content;
|
use ramhorns::Content;
|
||||||
|
|
||||||
#[get("/contrib")]
|
#[get("/contrib")]
|
||||||
async fn page(config: web::Data<Config>) -> impl Responder {
|
pub async fn page(config: web::Data<Config>) -> impl Responder {
|
||||||
Html(build_page(config.get_ref().to_owned()).await)
|
Html(build_page(config.get_ref().to_owned()).await)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ pub struct PathRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/cours")]
|
#[get("/cours")]
|
||||||
async fn page(info: web::Query<PathRequest>, config: web::Data<Config>) -> impl Responder {
|
pub async fn page(info: web::Query<PathRequest>, config: web::Data<Config>) -> impl Responder {
|
||||||
Html(build_page(&info, config.get_ref().to_owned()))
|
Html(build_page(&info, config.get_ref().to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use actix_web::{get, Responder};
|
use actix_web::{get, Responder};
|
||||||
|
|
||||||
#[get("/cv")]
|
#[get("/cv")]
|
||||||
async fn page() -> impl Responder {
|
pub async fn page() -> impl Responder {
|
||||||
// Génération du CV depuis un fichier externe TOML ?
|
// Génération du CV depuis un fichier externe TOML ?
|
||||||
// Cf. https://github.com/sinaatalay/rendercv
|
// Cf. https://github.com/sinaatalay/rendercv
|
||||||
// Faudrait une version HTML, et une version PDF
|
// Faudrait une version HTML, et une version PDF
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use actix_web::{get, Responder};
|
use actix_web::{get, Responder};
|
||||||
|
|
||||||
#[get("/gaming")]
|
#[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.
|
// Liste de mes comptes gaming, de mon setup, de mes configs de jeu, etc.
|
||||||
actix_web::web::Redirect::to("/")
|
actix_web::web::Redirect::to("/")
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
async fn page(config: web::Data<Config>) -> impl Responder {
|
pub async fn page(config: web::Data<Config>) -> impl Responder {
|
||||||
Html(build_page(config.get_ref().to_owned()))
|
Html(build_page(config.get_ref().to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use actix_web::{get, Responder};
|
use actix_web::{get, Responder};
|
||||||
|
|
||||||
#[get("/memorial")]
|
#[get("/memorial")]
|
||||||
async fn page() -> impl Responder {
|
pub async fn page() -> impl Responder {
|
||||||
// Memorial? J'espere ne jamais faire cette page lol
|
// Memorial? J'espere ne jamais faire cette page lol
|
||||||
actix_web::web::Redirect::to("/")
|
actix_web::web::Redirect::to("/")
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[get("/portfolio")]
|
#[get("/portfolio")]
|
||||||
async fn page(config: web::Data<Config>) -> impl Responder {
|
pub async fn page(config: web::Data<Config>) -> impl Responder {
|
||||||
Html(build_page(config.get_ref().to_owned()))
|
Html(build_page(config.get_ref().to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use actix_web::{get, Responder};
|
use actix_web::{get, Responder};
|
||||||
|
|
||||||
#[get("/setup")]
|
#[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
|
// Explication de l'histoire de par exemple wiki/cat et le follow up
|
||||||
// avec les futures video youtube probablement un shortcut
|
// avec les futures video youtube probablement un shortcut
|
||||||
// vers un billet de blog
|
// vers un billet de blog
|
||||||
|
|
|
@ -8,7 +8,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[get("/web3")]
|
#[get("/web3")]
|
||||||
async fn page(config: web::Data<Config>) -> impl Responder {
|
pub async fn page(config: web::Data<Config>) -> impl Responder {
|
||||||
Html(build_page(config.get_ref().to_owned()))
|
Html(build_page(config.get_ref().to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue