Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]

jobs:
quality-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run Biome checks
run: pnpm biome:check

- name: Type check
run: pnpm tsc --noEmit

- name: Build
run: pnpm build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-output
path: out/
retention-days: 1
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy to GitHub Pages

on:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Setup Pages
uses: actions/configure-pages@v4
with:
static_site_generator: next

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build with Next.js
run: pnpm build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"biome.requireConfiguration": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome",
Expand Down
58 changes: 58 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Development Commands

- `pnpm dev` - Start development server on localhost:3000
- `pnpm build` - Build the application for production (configured for static export)
- `pnpm start` - Start production server
- `pnpm biome:check` - Run Biome formatter and linter with auto-fix
- `pnpm biome:staged` - Run Biome on staged files only

## Code Quality

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.

## Architecture Overview

### Next.js Blog with MDX

This is a Next.js 15 blog application configured for static export with MDX support for content authoring.

**Key Technologies:**
- Next.js 15 with App Router
- MDX for blog content with rehype-pretty-code syntax highlighting
- Tailwind CSS for styling
- TypeScript
- Biome for code formatting/linting

### Directory Structure

- `src/app/` - Next.js App Router pages and layouts
- `src/contents/` - MDX blog posts (*.mdx files)
- `src/api/posts.ts` - Blog post data fetching utilities
- `src/app/blog/[slug]/` - Dynamic blog post pages

### Content Management

Blog posts are stored as MDX files in `src/contents/`. The `src/api/posts.ts` module handles:
- Reading MDX files from the contents directory
- Parsing frontmatter with gray-matter
- Generating static routes for blog posts

### Static Generation

The app is configured for static export (`output: 'export'` in next.config.ts) and uses:
- `generateStaticParams()` for blog post routes
- Dynamic imports for MDX components in blog pages

### Styling

- Uses Tailwind CSS with custom configuration
- Noto Sans KR font for Korean language support
- Prose styling for blog content rendering

### Build Output

Static files are generated in the `out/` directory during build.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
12 changes: 6 additions & 6 deletions components.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"tsx": true,
"tailwind": {
"config": "",
"css": "src/app/globals.css",
"css": "src/app/_styles/globals.css",
"baseColor": "stone",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
"components": "@/app/_components",
"utils": "@/app/_lib/utils",
"ui": "@/app/_components/ui",
"lib": "@/app/_lib",
"hooks": "@/app/_hooks"
},
"iconLibrary": "lucide"
}
2 changes: 1 addition & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const nextConfig: NextConfig = {
}

const withMDX = createMDX({
extension: /\.(md|mdx)$/,
extension: /\.(mdx)$/,
options: {
rehypePlugins: [
[
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"dev": "next dev",
"build": "next build",
"start": "next start",
"biome:check": "biome check --write --verbose",
Expand All @@ -16,6 +16,7 @@
"@types/mdx": "^2.0.13",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"gray-matter": "^4.0.3",
"lucide-react": "^0.525.0",
"next": "15.3.5",
"react": "^19.1.0",
Expand All @@ -26,6 +27,7 @@
"devDependencies": {
"@biomejs/biome": "^2.1.1",
"@tailwindcss/postcss": "^4.1.11",
"@tailwindcss/typography": "^0.5.16",
"@types/node": "^20.19.7",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
Expand Down
Loading