This commit is contained in:
parent
7339486467
commit
ec2389ce2f
1 changed files with 4 additions and 4 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue