Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 3.47 KB

File metadata and controls

73 lines (52 loc) · 3.47 KB

CLAUDE.md

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

Commands

npm run dev        # Start Astro dev server
npm run build      # Build static site to dist/
npm run preview    # Preview production build
npm run sync       # Sync books from Obsidian vault → src/content/books/

npm run sync reads from ~/vaults/obsidian-vault/entertainment/books/entries/ — local only, not available on Netlify. Netlify builds from committed src/content/books/ files.

No test runner configured.

Architecture

Static Astro site (SSG). Content lives in src/content/books/*.md (committed to git, sourced from Obsidian vault via scripts/sync-books.sh).

Data flow:

Obsidian vault → scripts/sync-books.sh → src/content/books/ → Astro build → dist/

The sync script filters only 완독 (finished) and 읽는 중 (reading) books, strips Obsidian-specific artifacts (Kindle location refs, local image links, redundant metadata lines), and normalizes content (converts ## Highlights## Quotes, wraps bullet items in blockquotes).

Key files:

  • src/content/config.ts — Zod schema for book frontmatter (permissive; all fields optional via flexStr)
  • src/utils/books.ts — Shared utilities: generateSlug, sortBooksByDate, getStartDate/getEndDate, getRatingCircles, detectLang
  • src/config.ts — Site title, URL, display strings
  • src/pages/index.astro — Book grid with genre filter chips, search, sort, dark/light mode
  • src/pages/books/[slug].astro — Individual book detail with sticky sidebar (PC), quotes section
  • src/pages/reader.astro — About page
  • src/layouts/BaseLayout.astro — HTML shell with OG tags, fonts (Pretendard Variable + Noto Serif KR)
  • src/styles/global.css — All styles; DoyoBoard Sanctuary color palette

Content Schema

Book frontmatter fields (all optional except 상태):

Field Notes
상태 ✅ 완독 or 📖 읽는 중 — only these publish
제목, 작가, 출판사, 출간일 Title, author, publisher, pub date
isbn Used as URL slug; falls back to title-derived slug
cover Image URL; hotlink-friendly CDNs: Aladin (image.aladin.co.kr), YES24, Millie (image.millie.co.kr — NOT img.millie.co.kr)
평점 Numeric rating (0–5); displayed as ●◐○ circles
한줄평 One-line review
startdate / enddate Explicit YYYY-MM-DD dates (preferred over 읽은날)
읽은날 Legacy: 2025/01/01 → 2025/01/15 format
장르 Comma-separated genres
시리즈, Series name and volume number
태그 Array or comma-separated string

Slug Generation

Slugs are ISBN-based when available; otherwise title-derived (lowercase, stripped special chars, max 50 chars). Both index.astro and [slug].astro must call resetSlugCounts() before generating slugs to ensure collision-free deduplication.

Design System

Palette — DoyoBoard Sanctuary:

  • Light: --color-bg: #f7f3ed, --color-accent: #d4886c (coral), --color-card: #fdfbf8
  • Dark: --color-bg-dark: #1a1614, --color-card-dark: #252220

Fonts: Pretendard Variable (Korean + Latin body), Noto Serif KR (headings/accents), JetBrains Mono (code)

Book cover images use a 3D CSS hover effect with spine shadow. Placeholder: coral gradient when no cover URL.

Deployment

Netlify auto-deploys on push to main. Build command: astro build, publish dir: dist/. Node 20.