Commit Graph

37 Commits

Author SHA1 Message Date
gbanyan e28beac1f1 Fix Pagefind file serving with API route
Fixed issue where Pagefind static files weren't accessible due to Next.js routing conflicts.

Solution:
- Created API route at app/pagefind/[...path]/route.ts to serve Pagefind files from .next/pagefind/
- Updated build script to copy pagefind index to public/_pagefind (backup)
- API route handles all /pagefind/* requests and serves files with proper content types
- Added caching headers for optimal performance

This resolves the "cannot type in search" issue - the search modal can now load Pagefind UI and index files correctly.

Technical Details:
- Next.js App Router was treating /pagefind/ as a route, returning 404
- Static files in public/ weren't accessible for subdirectories due to routing priority
- API route bypasses routing to serve .next/pagefind/* files directly
- Supports .js, .css, .json, .wasm, and Pagefind-specific file types

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 02:26:38 +08:00
gbanyan 912c70332e Fix tag URL encoding for non-ASCII characters
Fixed tag matching issue where tags with spaces and non-ASCII characters (like "Medicine - 醫學") were not working correctly on Vercel.

Changes:
1. Updated getTagSlug() to normalize tags without encoding - Next.js handles URL encoding automatically
2. Added decodeURIComponent() in tag page to decode incoming URL parameters
3. This ensures proper matching between generated slugs and URL parameters

The fix resolves:
- Tag archive pages showing wrong characters
- Articles not being collected under correct tags
- URL display issues with encoded characters

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 23:20:04 +08:00
gbanyan a4db9688b6 Upgrade to Next.js 16 with Turbopack and Contentlayer2
- Upgraded Next.js to v16, React to v19
- Migrated from contentlayer to contentlayer2
- Migrated to Turbopack by decoupling Contentlayer from webpack
- Updated all page components to handle async params (Next.js 15+ breaking change)
- Changed package.json to type: module and renamed config files to .cjs
- Updated README with current tech stack and article creation instructions
- Fixed tag encoding issue (removed double encoding)
- All security vulnerabilities resolved (npm audit: 0 vulnerabilities)
2025-11-19 22:43:14 +08:00
gbanyan 4c08413936 Migrate to Contentlayer2 2025-11-19 21:46:49 +08:00
gbanyan a249a120a5 Stage all layout updates 2025-11-19 17:38:45 +08:00
gbanyan 261cb1d91e Add favicon 2025-11-19 02:13:23 +08:00
gbanyan f32206d390 Use next/image for hero/sidebar/markdown images 2025-11-19 02:07:35 +08:00
gbanyan fe191752da Add aesthetic timeline to post lists 2025-11-19 00:54:58 +08:00
gbanyan 10e4e7e21e Give tags index a hero summary and card grid 2025-11-19 00:51:00 +08:00
gbanyan dc5ca97fee Add fluid typography scale and responsive headings 2025-11-19 00:22:09 +08:00
gbanyan 80d0b236c5 Refine navigation and post UI 2025-11-18 17:34:05 +08:00
gbanyan 96ebca37d6 Add storyline navigation rail for posts 2025-11-18 16:45:46 +08:00
gbanyan 4b3329d66f Add related posts section and blog search 2025-11-18 16:43:52 +08:00
gbanyan 23421a2980 Enlarge home hero heading text size 2025-11-17 23:41:03 +08:00
gbanyan f844655628 Center home hero heading and tagline in main column 2025-11-17 23:36:50 +08:00
gbanyan 0c5c5e230c Improve dark-mode readability of tags using neutral backgrounds 2025-11-17 23:15:15 +08:00
gbanyan 4cb3e7627b Introduce env-driven accent color system and apply to links, icons, and tags 2025-11-17 22:46:55 +08:00
gbanyan 77c127756e Shrink TOC column and gap to give articles more width 2025-11-17 22:19:51 +08:00
gbanyan a952c3cdc1 Let single post/pages use full main column width 2025-11-17 22:16:43 +08:00
gbanyan 675f5de74f Narrow content width and slightly increase base typography size 2025-11-17 22:08:26 +08:00
gbanyan dddf0f9340 Align static page layout and typography with blog posts 2025-11-17 21:40:08 +08:00
gbanyan 845be8a6fe Limit sidebar to top 5 popular tags and add tag index page 2025-11-17 21:31:39 +08:00
gbanyan 1fc34e2ef6 Add sort + pagination controls for blog and tag overviews 2025-11-17 21:20:08 +08:00
gbanyan 3b1a3eb6e1 Introduce colorful accents for tags, tag cloud, and hero 2025-11-17 20:23:45 +08:00
gbanyan bede4a2f3e Stabilize tag URLs using slugs instead of raw tag text 2025-11-17 18:48:50 +08:00
gbanyan 7c5962485c Link tags to tag pages and add tag overview 2025-11-17 18:40:27 +08:00
gbanyan 2c9074538e Fine-tune dark mode color layering for body, meta, and excerpts 2025-11-17 18:24:13 +08:00
gbanyan 309e7fc2bc Refine single post header layout and styling 2025-11-17 18:12:09 +08:00
gbanyan e83150ae46 Brighten single post typography in dark mode 2025-11-17 18:03:29 +08:00
gbanyan 0399b303c8 Adjust single post typography colors for dark mode 2025-11-17 18:00:01 +08:00
gbanyan 0bff9bf7f6 Align home and blog lists with reference style 2025-11-17 17:53:06 +08:00
gbanyan 78b28a5b7b Fix blog post import path typo 2025-11-17 17:10:13 +08:00
gbanyan 603274d025 Improve layout with hero, cards, typography, TOC and reading progress 2025-11-17 17:07:01 +08:00
gbanyan 237bb083cd Add and wire extended site env config 2025-11-17 16:51:59 +08:00
gbanyan 10948aa2ca Add env-based site configuration 2025-11-17 16:32:09 +08:00
gbanyan 48521d6f5c Rewrite markdown image URLs and render feature images 2025-11-17 16:26:20 +08:00
gbanyan 0c64279e34 Initial commit 2025-11-17 15:28:20 +08:00