diff --git a/src/routes/blog.rs b/src/routes/blog.rs index 35a7c49..a941d8f 100644 --- a/src/routes/blog.rs +++ b/src/routes/blog.rs @@ -239,13 +239,11 @@ fn get_post(post: &mut Option, filename: String, name: String) -> (Infos, Infos { page_title: Some(format!("Post: {}", title)), page_desc: Some(format!("Blog d'{name}")), - page_kw: Some( - ["blog", "blogging", "write", "writing"] - .iter() - .map(|&tag| tag.to_owned()) - .chain(tags.into_iter().map(|t| t.name)) - .collect::>() - .join(", "), + page_kw: make_kw( + &["blog", "blogging", "write", "writing"] + .into_iter() + .chain(tags.iter().map(|t| t.name.as_str())) + .collect::>(), ), }, toc, diff --git a/src/routes/contact.rs b/src/routes/contact.rs index d71db65..b348a2a 100644 --- a/src/routes/contact.rs +++ b/src/routes/contact.rs @@ -6,7 +6,10 @@ use std::fs::read_to_string; use crate::{ config::Config, - misc::markdown::{read_file, File, TypeFileMetadata}, + misc::{ + markdown::{read_file, File, TypeFileMetadata}, + utils::make_kw, + }, template::{Infos, NavBar}, }; @@ -165,7 +168,7 @@ fn build_page(config: Config) -> String { Infos { page_title: Some("Contacts".into()), page_desc: Some(format!("Réseaux d'{}", config.fc.name.unwrap_or_default())), - page_kw: None, + page_kw: make_kw(&["réseaux sociaux", "email", "contact", "linktree"]), }, ) } diff --git a/src/routes/contrib.rs b/src/routes/contrib.rs index 90f8e17..dedb5f7 100644 --- a/src/routes/contrib.rs +++ b/src/routes/contrib.rs @@ -2,7 +2,10 @@ use std::collections::HashMap; use crate::{ config::Config, - misc::github::{fetch_pr, ProjectState}, + misc::{ + github::{fetch_pr, ProjectState}, + utils::make_kw, + }, template::{Infos, NavBar}, }; use actix_web::{get, web, HttpResponse, Responder}; @@ -153,7 +156,15 @@ async fn build_page(config: Config) -> String { "Contributions à l'opensource par {}", config.fc.name.unwrap_or_default() )), - page_kw: None, + page_kw: make_kw(&[ + "github", + "contributions", + "open source", + "développement", + "portfolio", + "projets", + "code", + ]), }, ) } diff --git a/src/routes/index.rs b/src/routes/index.rs index c8cd0e8..6f1fa8e 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -4,6 +4,7 @@ use ramhorns::Content; use crate::{ config::Config, + misc::utils::make_kw, template::{Infos, NavBar}, }; @@ -36,7 +37,7 @@ fn build_page(config: Config) -> String { Infos { page_title: config.fc.fullname, page_desc: Some("Page principale".into()), - page_kw: None, + page_kw: make_kw(&["index", "étudiant"]), }, ) } diff --git a/src/routes/portfolio.rs b/src/routes/portfolio.rs index 13d3b52..70975c2 100644 --- a/src/routes/portfolio.rs +++ b/src/routes/portfolio.rs @@ -5,7 +5,10 @@ use ramhorns::Content; use crate::{ config::Config, - misc::markdown::{read_file, File, TypeFileMetadata}, + misc::{ + markdown::{read_file, File, TypeFileMetadata}, + utils::make_kw, + }, template::{Infos, NavBar}, }; @@ -72,7 +75,14 @@ fn build_page(config: Config) -> String { "Portfolio d'{}", config.fc.name.unwrap_or_default() )), - page_kw: None, + page_kw: make_kw(&[ + "développeur", + "portfolio", + "projets", + "programmation", + "applications", + "code", + ]), }, ) } diff --git a/src/routes/web3.rs b/src/routes/web3.rs index 32e9e33..0150b46 100644 --- a/src/routes/web3.rs +++ b/src/routes/web3.rs @@ -1,7 +1,7 @@ use actix_web::{get, web, HttpResponse, Responder}; use cached::proc_macro::once; -use crate::{config::Config, template::Infos}; +use crate::{config::Config, misc::utils::make_kw, template::Infos}; #[get("/web3")] async fn page(config: web::Data) -> impl Responder { @@ -16,7 +16,7 @@ fn build_page(config: Config) -> String { Infos { page_title: Some("Mylloon".into()), page_desc: Some("Coin reculé de l'internet".into()), - page_kw: None, + page_kw: make_kw(&["web3", "blockchain", "nft", "ai"]), }, ) }