use crate::helpers::*; use crate::posts::abstractions::post::Post; use askama::Template; #[derive(Template)] #[template(path = "posts.html")] pub struct PostsView { posts: Vec

, } impl PostsView

{ pub fn with_posts(posts: impl IntoIterator) -> Self { let mut posts: Vec

= posts.into_iter().collect(); posts.sort(); posts.reverse(); Self { posts } } }