fix sorting
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-04-20 15:19:41 +02:00
parent d9c9ff0828
commit 44266a3787
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 2 additions and 2 deletions

View file

@ -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(

View file

@ -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,