From 88c8676d3fa19936ea5447ec56093e995c5af603 Mon Sep 17 00:00:00 2001 From: HangerThem Date: Mon, 19 Oct 2026 14:17:18 +0200 Subject: [PATCH] perf: image loading, smaller assets, server-rendered code blocks - Only preload the post cover and latest-post image instead of every image - Drop in-post image quality from 100 to 90 and add responsive sizes - Downscale 2940px screenshots to 1800px; convert linkboard-old to WebP (3.1 MB -> 60 KB) - Make CodeWrapper a server component; only CopyButton ships to the client - Pin the Mermaid CDN script to an exact version for reproducible builds --- app/posts/[slug]/page.tsx | 4 +++- components/content/CodeWrapper.tsx | 16 +++++++--------- components/content/ImageWrapper.tsx | 25 ++++++++++++++++++++----- components/post/Post.tsx | 9 ++++++++- content/pages/projects.md | 2 +- lib/mermaid-render.ts | 2 +- lib/posts.tsx | 4 +++- next.config.ts | 2 +- public/posts/bitez-dashboard.png | Bin 482373 -> 273171 bytes public/posts/linkboard-editor.png | Bin 725270 -> 429147 bytes public/posts/linkboard-new.png | Bin 191036 -> 105283 bytes public/posts/linkboard-old.png | Bin 3154582 -> 0 bytes public/posts/linkboard-old.webp | Bin 0 -> 60462 bytes 13 files changed, 44 insertions(+), 20 deletions(-) delete mode 100644 public/posts/linkboard-old.png create mode 100644 public/posts/linkboard-old.webp diff --git a/app/posts/[slug]/page.tsx b/app/posts/[slug]/page.tsx index 43cfaf9..ee750ab 100644 --- a/app/posts/[slug]/page.tsx +++ b/app/posts/[slug]/page.tsx @@ -109,7 +109,9 @@ export default async function Post({ params }: { params: Promise<{ slug: string for SEO. )} - {meta.coverImage && } + {meta.coverImage && ( + + )}
{content}
{meta.tags && ( diff --git a/components/content/CodeWrapper.tsx b/components/content/CodeWrapper.tsx index 1f75cc8..6235291 100644 --- a/components/content/CodeWrapper.tsx +++ b/components/content/CodeWrapper.tsx @@ -1,5 +1,3 @@ -'use client' - import { CopyButton } from '@/components/ui/CopyButton' import { getTextContent } from '@/lib/react-node-text' @@ -13,12 +11,9 @@ export function CodeWrapper({ language, children }: CodeWrapperProps) { const lineCount = text.length === 0 ? 1 : text.split('\n').length return ( -
-