The site is built with Next.js and Nextra, a documentation framework. Content is written in MDX (Markdown + JSX) in the src/content/ directory.
Project structure:
src/content/- MDX content filessrc/content/_meta.ts- Page configuration (titles, navigation)src/app/- Next.js App Router structuresrc/components/- React componentspublic/- Static assets
Git hooks: This project uses Lefthook for Git hooks:
- Pre-commit: Runs ESLint auto-fix and TypeScript type checking
- Commit-msg: Validates conventional commit format
To open the dev server through a LAN address, set
NEXT_ALLOWED_DEV_ORIGINS=192.168.1.10 in .env.local, using your server's
IP or hostname, then restart pnpm dev. Separate multiple hosts with commas.
Build the site:
pnpm buildThis generates a static export in the ./out directory.
Lint your code:
pnpm lint # Check for errors
pnpm lint:fix # Auto-fix errorsType check:
pnpm run check:typesCheck for unused dependencies:
pnpm run check:depsAnalyze bundle size:
pnpm run analyzeThe site is automatically deployed to GitHub Pages when changes are pushed to the develop branch. The CI workflow:
- Runs linting and type checking
- Builds the static site
- Deploys to GitHub Pages
You can preview the production build locally by serving the ./out directory:
npx serve ./out