better arg name
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-04-19 20:11:13 +02:00
parent 7339486467
commit ec2389ce2f
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -11,18 +11,18 @@ pub fn get_reqwest_client() -> Client {
.unwrap() .unwrap()
} }
pub fn get_post(post: &mut Option<File>, file: String) -> Infos { pub fn get_post(post: &mut Option<File>, filename: String) -> Infos {
let blog_dir = "data/blog"; let blog_dir = "data/blog";
let ext = ".md"; let ext = ".md";
*post = read_md_file(&format!("{blog_dir}/{file}{ext}")); *post = read_md_file(&format!("{blog_dir}/{filename}{ext}"));
let title = match post { let title = match post {
Some(data) => match &data.metadata.info.title { Some(data) => match &data.metadata.info.title {
Some(text) => text, Some(text) => text,
None => &file, None => &filename,
}, },
None => &file, None => &filename,
}; };
Infos { Infos {