This commit is contained in:
parent
cc0d787328
commit
76a79bf192
3 changed files with 7 additions and 3 deletions
|
@ -13,6 +13,7 @@ pub struct FileMetadata {
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
pub link: Option<String>,
|
pub link: Option<String>,
|
||||||
pub date: Option<Date>,
|
pub date: Option<Date>,
|
||||||
|
pub description: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Content)]
|
#[derive(Content)]
|
||||||
|
|
|
@ -51,6 +51,7 @@ struct Post {
|
||||||
title: String,
|
title: String,
|
||||||
date: Date,
|
date: Date,
|
||||||
url: String,
|
url: String,
|
||||||
|
desc: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_posts(location: &str) -> Vec<Post> {
|
fn get_posts(location: &str) -> Vec<Post> {
|
||||||
|
@ -86,8 +87,7 @@ fn get_posts(location: &str) -> Vec<Post> {
|
||||||
}
|
}
|
||||||
Err(_) => FileMetadata {
|
Err(_) => FileMetadata {
|
||||||
title: Some(file_without_ext.to_owned()),
|
title: Some(file_without_ext.to_owned()),
|
||||||
link: None,
|
..FileMetadata::default()
|
||||||
date: None,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,6 +107,7 @@ fn get_posts(location: &str) -> Vec<Post> {
|
||||||
year: date.year(),
|
year: date.year(),
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
desc: file_metadata.description,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<Post>>()
|
.collect::<Vec<Post>>()
|
||||||
|
|
|
@ -34,7 +34,9 @@
|
||||||
>
|
>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h3><a href="/blog/{{url}}">{{title}}</a></h3>
|
<h3><a href="/blog/{{url}}">{{title}}</a></h3>
|
||||||
<p>SHORT DESC</p>
|
{{#desc}}
|
||||||
|
<p>{{desc}}</p>
|
||||||
|
{{/desc}}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/posts}}
|
{{/posts}}
|
||||||
|
|
Loading…
Reference in a new issue