Add description
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-04-24 18:41:40 +02:00
parent cc0d787328
commit 76a79bf192
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 7 additions and 3 deletions

View file

@ -13,6 +13,7 @@ pub struct FileMetadata {
pub title: Option<String>,
pub link: Option<String>,
pub date: Option<Date>,
pub description: Option<String>,
}
#[derive(Content)]

View file

@ -51,6 +51,7 @@ struct Post {
title: String,
date: Date,
url: String,
desc: Option<String>,
}
fn get_posts(location: &str) -> Vec<Post> {
@ -86,8 +87,7 @@ fn get_posts(location: &str) -> Vec<Post> {
}
Err(_) => FileMetadata {
title: Some(file_without_ext.to_owned()),
link: None,
date: None,
..FileMetadata::default()
},
};
@ -107,6 +107,7 @@ fn get_posts(location: &str) -> Vec<Post> {
year: date.year(),
}
}),
desc: file_metadata.description,
}
})
.collect::<Vec<Post>>()

View file

@ -34,7 +34,9 @@
>
<div class="content">
<h3><a href="/blog/{{url}}">{{title}}</a></h3>
<p>SHORT DESC</p>
{{#desc}}
<p>{{desc}}</p>
{{/desc}}
</div>
</li>
{{/posts}}