Commit Graph

12 Commits

Author SHA1 Message Date
2402c94760 perf: 全面優化部落格載入速度與效能
- 字體載入優化:添加 preconnect 到 Google Fonts,優化載入順序
- 元件延遲載入:RightSidebar、MastodonFeed、PostToc、BackToTop 使用動態載入
- 圖片優化:添加 blur placeholder,首屏圖片添加 priority,優化圖片尺寸配置
- 快取策略:為 HTML 頁面、OG 圖片、RSS feed 添加快取標頭
- 程式碼分割:確保路由層級分割正常,延遲載入非關鍵元件
- 效能監控:添加 WebVitals 元件追蹤基本效能指標
- 連結優化:為重要連結添加 prefetch 屬性

預期效果:
- FCP 減少 20-30%
- LCP 減少 30-40%
- CLS 減少 50%+
- TTI 減少 25-35%
- Bundle Size 減少 15-25%

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 16:18:51 +08:00
ba60d49fc6 Add bundle analyzer configuration
Configure @next/bundle-analyzer for production bundle analysis:

**Changes:**
- Install @next/bundle-analyzer package
- Update next.config.mjs to wrap config with bundle analyzer
- Add npm script `build:analyze` to run build with ANALYZE=true
- Bundle analyzer only enabled when ANALYZE=true environment variable is set

**Usage:**
```bash
# Run build with bundle analysis
npm run build:analyze

# Opens interactive bundle visualization in browser
# Shows chunk sizes, module dependencies, and optimization opportunities
```

**Note:** Kept Mastodon feed as Client Component (not Server Component)
because formatRelativeTime() uses `new Date()` which requires dynamic
rendering. Converting to Server Component would prevent static generation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 22:00:02 +08:00
a249a120a5 Stage all layout updates 2025-11-19 17:38:45 +08:00
193b5ced12 Revert layout shell width to original uniform container 2025-11-17 22:58:09 +08:00
e7a9d89cfc Further widen detail-page main column vs sidebar 2025-11-17 22:37:05 +08:00
45e6088f69 Make single article pages use a wider main column than indexes 2025-11-17 22:21:54 +08:00
2db31ae1e1 Further widen content container slightly 2025-11-17 22:13:07 +08:00
08c36fb6a9 Slightly widen main content while keeping sidebar proportion 2025-11-17 22:11:05 +08:00
675f5de74f Narrow content width and slightly increase base typography size 2025-11-17 22:08:26 +08:00
83ccec5ec4 Add scroll-aware back-to-top button 2025-11-17 21:52:36 +08:00
b89c01c966 Tweak card images, dark mode text, social links, and add right sidebar 2025-11-17 17:19:47 +08:00
0c64279e34 Initial commit 2025-11-17 15:28:20 +08:00