|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Development Commands |
| 6 | + |
| 7 | +- `pnpm dev` - Start development server on localhost:3000 |
| 8 | +- `pnpm build` - Build the application for production (configured for static export) |
| 9 | +- `pnpm start` - Start production server |
| 10 | +- `pnpm biome:check` - Run Biome formatter and linter with auto-fix |
| 11 | +- `pnpm biome:staged` - Run Biome on staged files only |
| 12 | + |
| 13 | +## Code Quality |
| 14 | + |
| 15 | +This project uses Biome for formatting and linting. Always run `pnpm biome:check` before committing changes. The project has a pre-commit hook (lefthook) that automatically runs Biome on staged files. |
| 16 | + |
| 17 | +## Architecture Overview |
| 18 | + |
| 19 | +### Next.js Blog with MDX |
| 20 | + |
| 21 | +This is a Next.js 15 blog application configured for static export with MDX support for content authoring. |
| 22 | + |
| 23 | +**Key Technologies:** |
| 24 | +- Next.js 15 with App Router |
| 25 | +- MDX for blog content with rehype-pretty-code syntax highlighting |
| 26 | +- Tailwind CSS for styling |
| 27 | +- TypeScript |
| 28 | +- Biome for code formatting/linting |
| 29 | + |
| 30 | +### Directory Structure |
| 31 | + |
| 32 | +- `src/app/` - Next.js App Router pages and layouts |
| 33 | +- `src/contents/` - MDX blog posts (*.mdx files) |
| 34 | +- `src/api/posts.ts` - Blog post data fetching utilities |
| 35 | +- `src/app/blog/[slug]/` - Dynamic blog post pages |
| 36 | + |
| 37 | +### Content Management |
| 38 | + |
| 39 | +Blog posts are stored as MDX files in `src/contents/`. The `src/api/posts.ts` module handles: |
| 40 | +- Reading MDX files from the contents directory |
| 41 | +- Parsing frontmatter with gray-matter |
| 42 | +- Generating static routes for blog posts |
| 43 | + |
| 44 | +### Static Generation |
| 45 | + |
| 46 | +The app is configured for static export (`output: 'export'` in next.config.ts) and uses: |
| 47 | +- `generateStaticParams()` for blog post routes |
| 48 | +- Dynamic imports for MDX components in blog pages |
| 49 | + |
| 50 | +### Styling |
| 51 | + |
| 52 | +- Uses Tailwind CSS with custom configuration |
| 53 | +- Noto Sans KR font for Korean language support |
| 54 | +- Prose styling for blog content rendering |
| 55 | + |
| 56 | +### Build Output |
| 57 | + |
| 58 | +Static files are generated in the `out/` directory during build. |
0 commit comments