Next.js 16.2.2 (App Router) + TypeScript + Tailwind CSS, fully static export (output: "export", distDir: "output"). No server, no API routes, no database.
| Cmd | What |
|---|---|
npm run dev |
Dev server at localhost:3000 |
npm run build |
Build + postbuild (copy assets, RSS, sitemap) → output/ |
npm run deploy |
Build + submit URLs to IndexNow and/or Bing (non-fatal) |
npm run postsubmit |
Regenerate sitemap + submit URLs (resumes if partial) |
paramsandsearchParamsare Promises — mustawaitthem.- All pages use
generateStaticParams()for dynamic routes. trailingSlash: true— URLs end with/, output ispath/index.html.
content/posts/[id]/index.md— frontmatter:title,published,description,category,tags,draft.content/docs/[collection]/{*.md, meta.json}—meta.json: published: falsehides the collection.content/spec/{about,projects,information,journey}/index.md— static spec pages.content/moments/[id]/index.md— short posts with photos.content/demos/[id]/{meta.json, demo.html}— iframe demos.- Paths must be ASCII/lowercase/hyphenated — no spaces, no non-ASCII.
Client-side only (React Context + localStorage + JSON translations in lib/i18n/translations/). No [locale] route param. 6 languages: zh, en, es, ja, de, fr.
next build → postbuild: copy-assets.js → generate-rss.js → generate-sitemap.js. The sitemap only includes posts/, docs/, spec/ content (excludes demos, moments).
Key: public/c323c6da4b4949cf9b4f87cdcc7586e3.txt (Bing API key). Submit via npm run deploy or npm run postsubmit. Tries IndexNow first, falls back to Bing URL Submission API if IndexNow rejects.
Build command: npm run deploy. Output dir: output. Set env vars in dashboard (.env is gitignored except .env.example).
content/*/ → lib/*.ts (read + parse) → app/*/page.tsx (generateStaticParams) → static HTML
lib/markdown.ts handles unified/remark/rehype pipeline. Key libs: lib/posts.ts, lib/docs.ts, lib/moments.ts, lib/demos.ts, lib/markdown.ts.
- Business/client components use
'use client'suffix pattern, live incomponents/features/. - i18n context in
components/i18n/, UI primitives incomponents/ui/. - No state management library — React Context for i18n,
useState/useEffectfor local state. - Giscus for comments, Live2D for mascot,
natural-falling-jsfor seasonal particles.
docs/.ai/— full AI dev docs (readindex.mdfirst for priority-ordered docs).docs/deploy-cloudflare.md— CF Pages setup details.docs/prompts.txt,docs/demo.txt— scratch/user notes.README.md— has content format examples and env reference.