Skip to content

Commit 3b1b097

Browse files
committed
feat: add page speed improvements
1 parent ea47dd0 commit 3b1b097

File tree

6 files changed

+5
-6
lines changed

6 files changed

+5
-6
lines changed

public/rust_color.png

-83.8 KB
Binary file not shown.

public/rust_color.webp

10.1 KB
Binary file not shown.

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use leptos::prelude::*;
44
use leptos_meta::*;
55
use leptos_router::{
66
components::{FlatRoutes, Route, Router},
7-
ParamSegment, StaticSegment,
7+
ParamSegment, SsrMode, StaticSegment,
88
};
99

1010
use crate::{home, post};
@@ -196,7 +196,7 @@ pub fn App() -> impl IntoView {
196196
outside_errors.insert_with_default_key(AppError::NotFound);
197197
view! { <ErrorTemplate outside_errors /> }.into_view()
198198
}>
199-
<Route path=StaticSegment("") view=home::Component />
199+
<Route path=StaticSegment("") view=home::Component ssr=SsrMode::InOrder />
200200
<Route
201201
path=(StaticSegment("post"), ParamSegment("slug"))
202202
view=post::Component

src/home.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ pub fn Component() -> impl IntoView {
2828
>
2929
<div class="flex flex-col p-3 text-left text-white rounded-lg transition-all duration-500 cursor-pointer break-inside-avoid bg-card hover:text-[#ffef5c]">
3030
<A href=format!("/post/{}", post.slug.as_ref().map_or("", |v| v))>
31-
<div class="flex flex-col gap-1 mb-4">
32-
<p class="text-base font-medium line-clamp-2">{post.title}</p>
31+
<div class="flex flex-col gap-1 mb-4 font-medium">
32+
<p class="text-base line-clamp-2">{post.title}</p>
3333
<p class="italic text-xxs">{post.summary}</p>
3434
</div>
3535
<div class="flex flex-row gap-3 justify-start items-center text-xxs">

src/loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use leptos::prelude::*;
44
pub fn Component() -> impl IntoView {
55
view! {
66
<div class="flex absolute inset-0 flex-col gap-1 justify-center items-center m-auto">
7-
<img src="/rust_color.png" width=32 height=32 class="animate-spin" />
7+
<img src="/rust_color.webp" width=32 height=32 class="animate-spin" />
88
<p class="text-sm italic text-muted-foreground">Loading...</p>
99
</div>
1010
}

src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ async fn main() {
1111
use leptos::logging;
1212
use leptos::prelude::*;
1313
use leptos_axum::{generate_route_list, LeptosRoutes};
14-
use std::env;
1514
use tower_http::compression::predicate::{NotForContentType, SizeAbove};
1615
use tower_http::compression::{CompressionLayer, Predicate};
1716
use tower_http::trace::TraceLayer;

0 commit comments

Comments
 (0)