Browse Source

Sort posts by date

master
Dylan Baker 3 years ago
parent
commit
a816e38af1
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/fs.rs

+ 3
- 0
src/fs.rs View File

@@ -19,6 +19,9 @@ pub async fn get_all_posts() -> Result<Vec<Post>, Error> {
19 19
         }
20 20
     }
21 21
 
22
+    posts.sort_by_key(|el| el.date.clone());
23
+    posts.reverse();
24
+
22 25
     Ok(posts)
23 26
 }
24 27
 

Loading…
Cancel
Save