From 3c21063026746af5bc1c11335243ea830d607c8b Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 30 Oct 2025 11:43:05 +0800 Subject: perf: dynamically load libra.js Former-commit-id: 11c2cc7e2c8da0278682d6655edaa5b28854b8cd --- layouts/_partials/scripts/libra-js.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/_partials/scripts/libra-js.html b/layouts/_partials/scripts/libra-js.html index 0eea3d07..95e121ed 100644 --- a/layouts/_partials/scripts/libra-js.html +++ b/layouts/_partials/scripts/libra-js.html @@ -1,4 +1,6 @@ -- cgit v1.2.3 From a7bb422c444a71c4e817b0f233e7359fd65cb414 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 30 Oct 2025 11:53:05 +0800 Subject: perf: significantly reduce header image size Former-commit-id: 8e1b9428065ffda12ad5cb0a1fee6364ae942709 --- layouts/_partials/components/logo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_partials/components/logo.html b/layouts/_partials/components/logo.html index 63f500c5..e44fc9e9 100644 --- a/layouts/_partials/components/logo.html +++ b/layouts/_partials/components/logo.html @@ -1,4 +1,4 @@ -{{ $default := "https://image.guhub.cn/uPic/2025/05/header.png" }} +{{ $default := "https://image.guhub.cn/uPic/2025/05/header.png!w160" }} {{ $link := .link | default "" }} {{ $src := .src | default $default }} {{ $class := .class | default "" }} -- cgit v1.2.3 From e858f6c7dcb8f480195cecc7a6f665d98fb059f6 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 30 Oct 2025 11:59:50 +0800 Subject: perf: reduce DOM size by showing less posts at home Former-commit-id: 9e6cb4e4d6c40b9060f8b64643bb5d6615ef7fa0 --- layouts/_partials/home/latest-posts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_partials/home/latest-posts.html b/layouts/_partials/home/latest-posts.html index cf80ece6..8195b481 100644 --- a/layouts/_partials/home/latest-posts.html +++ b/layouts/_partials/home/latest-posts.html @@ -2,7 +2,7 @@
{{ $firstPost := true }} - {{ range first 12 (where site.RegularPages "Type" "in" site.Params.mainSections) }} + {{ range first 5 (where site.RegularPages "Type" "in" site.Params.mainSections) }} {{ partial "items/post" (dict "ctx" . "showSummary" $firstPost -- cgit v1.2.3 From 25d8c5a8aada7eba865a0332599c0704254a42c7 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 30 Oct 2025 12:06:20 +0800 Subject: perf: reduce DOM depth Former-commit-id: 7818468d60baf186004b7e1c440bea91da1b3448 --- layouts/_partials/home/home-nav-item.html | 24 ++++++------- layouts/_partials/home/home-nav.html | 56 ++++++++++++++----------------- layouts/_partials/home/latest-posts.html | 27 +++++++-------- 3 files changed, 50 insertions(+), 57 deletions(-) diff --git a/layouts/_partials/home/home-nav-item.html b/layouts/_partials/home/home-nav-item.html index 639e9762..71eb8883 100644 --- a/layouts/_partials/home/home-nav-item.html +++ b/layouts/_partials/home/home-nav-item.html @@ -2,16 +2,14 @@ {{ $link := .link }} {{ $text := .text }} - + + {{ if $active }} +
+ {{ end }} + {{ $text }} +
diff --git a/layouts/_partials/home/home-nav.html b/layouts/_partials/home/home-nav.html index e967b222..fd637ff9 100644 --- a/layouts/_partials/home/home-nav.html +++ b/layouts/_partials/home/home-nav.html @@ -1,35 +1,31 @@ {{ if eq .Site.Language.Lang "zh" }} -
-
+ + Cthulu-style monster with an eye. + + {{ end }} diff --git a/layouts/_partials/home/latest-posts.html b/layouts/_partials/home/latest-posts.html index 8195b481..2a0beccd 100644 --- a/layouts/_partials/home/latest-posts.html +++ b/layouts/_partials/home/latest-posts.html @@ -1,16 +1,15 @@ -
-
- {{ $firstPost := true }} - {{ range first 5 (where site.RegularPages "Type" "in" site.Params.mainSections) }} - {{ partial "items/post" (dict - "ctx" . - "showSummary" $firstPost - ) }} - {{ $firstPost = false }} - {{ end }} -
- - {{ T "moreLinks.posts" }} → - +
+ {{ $firstPost := true }} + {{ range first 5 (where site.RegularPages "Type" "in" site.Params.mainSections) }} + {{ partial "items/post" (dict + "ctx" . + "showSummary" $firstPost + ) }} + {{ $firstPost = false }} + {{ end }}
+ + + {{ T "moreLinks.posts" }} → + -- cgit v1.2.3