Skip to content

Commit

Permalink
Pequeno ajuste de ordenação
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphyBR authored Apr 11, 2024
1 parent 261695b commit 0e5a3ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/contexts/posts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn get_posts_data() -> Vec<PostData> {
options.compile.allow_dangerous_html = true;
options.parse.constructs.frontmatter = true;

let posts = FILES
let mut posts: Vec<PostData> = FILES
.iter()
.map(|file| {
let matter = Matter::<YAML>::new();
Expand All @@ -46,5 +46,8 @@ fn get_posts_data() -> Vec<PostData> {
})
.collect();

posts.sort_by_key(|p| p.metadata.date);
posts.reverse();

posts
}

0 comments on commit 0e5a3ce

Please sign in to comment.