|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is a Gatsby-based blog/portfolio website (junghyeonsu.com) built with TypeScript, React, and Chakra UI. The site serves MDX content for blog posts organized by categories and tags, with multilingual support (Korean/English). |
| 8 | + |
| 9 | +## Development Commands |
| 10 | + |
| 11 | +```bash |
| 12 | +# Development server |
| 13 | +yarn dev |
| 14 | +# or |
| 15 | +yarn develop |
| 16 | + |
| 17 | +# Build for production |
| 18 | +yarn build |
| 19 | + |
| 20 | +# Type checking |
| 21 | +yarn typecheck |
| 22 | + |
| 23 | +# Serve production build locally |
| 24 | +yarn serve |
| 25 | + |
| 26 | +# Clean build artifacts |
| 27 | +yarn clean |
| 28 | +``` |
| 29 | + |
| 30 | +## Architecture & Key Concepts |
| 31 | + |
| 32 | +### Content Management |
| 33 | +- **Blog Posts**: Located in `/content/` directory, organized by category folders |
| 34 | +- **Portfolio**: Single MDX file in `/portfolio/` directory |
| 35 | +- **Frontmatter**: Each MDX file uses frontmatter for metadata (title, slug, tags, createdAt, description, etc.) |
| 36 | +- **Multilingual**: Posts can have `locale` field (English posts), Korean posts have no locale field |
| 37 | + |
| 38 | +### Gatsby Configuration |
| 39 | +- **Page Generation**: `gatsby-node.js` creates pages dynamically: |
| 40 | + - Individual post pages at `/posts/{slug}` (Korean) or `/{locale}/posts/{slug}` (English) |
| 41 | + - Paginated tag pages at `/tags/{tag}` and `/tags/{tag}/{pageNumber}` |
| 42 | + - Paginated homepage at `/` and `/{pageNumber}` |
| 43 | + - Portfolio page at `/portfolio` |
| 44 | +- **Content Sources**: MDX files from `/content/` and `/portfolio/` directories |
| 45 | +- **Image Processing**: Gatsby Sharp plugins for optimized images with max width 800px |
| 46 | +- **Typography**: Uses Pretendard font loaded via web font loader |
| 47 | + |
| 48 | +### Component Architecture |
| 49 | +- **Layouts**: |
| 50 | + - `MainLayout`: Standard page wrapper with header/footer, 900px max width |
| 51 | + - `PostLayout`: MDX content wrapper with wider max width (800px base, 1100px xl), includes MDXProvider |
| 52 | +- **Theme System**: Chakra UI with custom theme in `/src/chakra/` |
| 53 | + - Custom breakpoints: sm(320px), md(768px), lg(960px), xl(1200px), 2xl(1536px) |
| 54 | + - Custom colors and semantic tokens |
| 55 | +- **MDX Components**: Custom components in `/src/components/mdx/` for enhanced content rendering |
| 56 | + |
| 57 | +### TypeScript & Build |
| 58 | +- **Type Generation**: Gatsby TypeGen generates GraphQL types in `src/__generated__/gatsby-types.d.ts` |
| 59 | +- **ESLint**: Airbnb TypeScript config with Prettier integration |
| 60 | +- **Package Manager**: Yarn v4.8.1 (check yarn version before installing packages) |
| 61 | +- **Node Version**: Requires Node.js >=18.0.0 |
| 62 | + |
| 63 | +### Content Structure |
| 64 | +- Posts are organized by category folders under `/content/` |
| 65 | +- Each post folder contains the MDX file and associated images |
| 66 | +- Reading time is calculated at 500 words per minute |
| 67 | +- Pagination shows 10 posts per page |
| 68 | + |
| 69 | +## Common Development Patterns |
| 70 | + |
| 71 | +When adding new blog posts: |
| 72 | +- Create folder under appropriate category in `/content/` |
| 73 | +- Include MDX file with proper frontmatter |
| 74 | +- Images should be co-located in the same folder |
| 75 | +- Use `yarn develop` to see changes in development |
| 76 | + |
| 77 | +When modifying components: |
| 78 | +- Follow existing Chakra UI patterns |
| 79 | +- Maintain responsive design using custom breakpoints |
| 80 | +- Use semantic tokens for colors when possible |
| 81 | +- TypeScript is strict mode enabled |
0 commit comments