This commit is contained in:
parent
d9c9ff0828
commit
44266a3787
2 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ pub fn get_index(config: Config) -> String {
|
|||
.collect::<Vec<Post>>();
|
||||
|
||||
// Sort from newest to oldest
|
||||
posts.sort_by_cached_key(|p| p.date.clone());
|
||||
posts.sort_by_cached_key(|p| (p.date.year, p.date.month, p.date.day));
|
||||
posts.reverse();
|
||||
|
||||
config.tmpl.render(
|
||||
|
|
|
@ -59,7 +59,7 @@ impl FrontMatter<'_> {
|
|||
}
|
||||
}
|
||||
}
|
||||
#[derive(Content, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Content, Default)]
|
||||
pub struct Date {
|
||||
pub day: u32,
|
||||
pub month: u32,
|
||||
|
|
Loading…
Reference in a new issue