Skip to content

Commit b9b6321

Browse files
z0ffyclaude
andcommitted
docs: add CLAUDE.md for codebase guidance
chore(deps): bump ESLint, Tailwind CSS, and related dependencies Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a52119f commit b9b6321

3 files changed

Lines changed: 368 additions & 304 deletions

File tree

CLAUDE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
Personal blog site using GitHub Issues as the content source. Built on the [Gossip](https://github.com/qianxi0410/gossip) architecture. Issues tagged with `published` label are rendered as blog posts.
8+
9+
**Stack**: Next.js 16 (React 19) + TypeScript + Tailwind CSS 4 + Octokit (GitHub API)
10+
11+
## Commands
12+
13+
```bash
14+
pnpm dev # Development server (localhost:3000)
15+
pnpm build # Static export to out/
16+
pnpm start # Preview production build
17+
pnpm lint # ESLint check
18+
pnpm fix # ESLint with auto-fix
19+
```
20+
21+
## Environment Variables
22+
23+
Create `.env.local` with:
24+
- `OWNER` - GitHub username (required)
25+
- `REPO` - Repository name (required)
26+
- `ACCESS_TOKEN` - GitHub PAT with repo scope (required)
27+
- `GOOGLE_ANALYTICS_ID` - GA tracking ID (optional)
28+
- `DEPLOY_TARGET` - Set to `gh-pages` for GitHub Pages deployment
29+
30+
## Architecture
31+
32+
**Data Flow**: GitHub Issues → Octokit API → `lib/post.ts` → Static pages at build time
33+
34+
**Key Directories**:
35+
- `pages/` - Next.js pages router with dynamic routes for posts (`[id].tsx`) and tags (`tag/[id].tsx`)
36+
- `lib/` - Core data fetching logic
37+
- `cli.ts` - Octokit client initialization
38+
- `post.ts` - Fetch posts, tags, and paths from GitHub Issues API
39+
- `components/` - React components (markdown renderer, header, footer, comments, theme toggle)
40+
- `gossip.d.ts` - Type definitions for Post, User, and custom NextPageWithLayout
41+
42+
**Configuration**: Site settings in `next.config.js` under `env`:
43+
- `comment` - Enable Utterances comments (`'true'`/`'false'`)
44+
- `theme` - Theme mode (`'light'`/`'dark'`/`'both'`)
45+
- `rss` - Generate RSS feed (`'true'`/`'false'`)
46+
- `back2top` - Show back-to-top button
47+
- `mail`, `twitter`, `bio` - User info display
48+
49+
**Deployment**: Uses `output: "export"` for static site generation. For GitHub Pages with non-username.github.io repos, `basePath` is auto-configured.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424
"sakana-widget": "^2.7.1"
2525
},
2626
"devDependencies": {
27-
"@eslint/js": "^9.0.0",
28-
"@next/eslint-plugin-next": "^16.2.2",
27+
"@eslint/js": "^9.39.4",
28+
"@next/eslint-plugin-next": "^16.2.4",
2929
"@next/third-parties": "16.2.2",
30-
"@tailwindcss/postcss": "^4.2.2",
30+
"@tailwindcss/postcss": "^4.2.4",
3131
"@types/node": "25.5.2",
3232
"@types/react": "19.2.14",
3333
"@types/react-dom": "19.2.3",
3434
"@types/react-syntax-highlighter": "^15.5.13",
3535
"@types/rss": "^0.0.32",
3636
"eslint": "9.39.4",
3737
"eslint-config-next": "16.2.2",
38-
"eslint-plugin-react-hooks": "^7.0.1",
38+
"eslint-plugin-react-hooks": "^7.1.1",
3939
"next-sitemap": "^4.2.3",
40-
"postcss": "^8.5.8",
41-
"tailwindcss": "^4.2.2",
40+
"postcss": "^8.5.12",
41+
"tailwindcss": "^4.2.4",
4242
"typescript": "6.0.2"
4343
},
4444
"pnpm": {

0 commit comments

Comments
 (0)