diff --git a/src/routes/blog.rs b/src/routes/blog.rs index 33322f6..6176534 100644 --- a/src/routes/blog.rs +++ b/src/routes/blog.rs @@ -83,7 +83,7 @@ pub fn get_index(config: Config) -> String { .collect::>(); // 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( diff --git a/src/template.rs b/src/template.rs index 8fe0fe1..273a679 100644 --- a/src/template.rs +++ b/src/template.rs @@ -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,