Skip to content

Commit

Permalink
Only show the first 20 lines of posts in the main view to make the in…
Browse files Browse the repository at this point in the history
…itial request smaller
  • Loading branch information
itsjunetime committed Dec 11, 2023
1 parent 157013b commit da9e6bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/src/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ impl RenderOnce for Posts {
}
}
}
div(class = "post-content") : Raw(post.html);
div(class = "post-content") : Raw(
// only do the first 20 lines since it's gonna hide past that
post.html.split("br")
.take(20)
.collect::<Vec<&str>>()
.join("br")
);
div(class = "post-footer") {
: "Posted at ";
strong : shared_data::title_time_string(post.created_at);
Expand Down

0 comments on commit da9e6bd

Please sign in to comment.