Files
slide/CLAUDE.md
T
2026-05-27 11:47:18 +08:00

2.6 KiB

Slide Project

Multi-deck Slidev presentation project. Remote Gitea repo with Docker-based CI/CD auto-deployment.

Slidev Skill

All slide-related operations (create, edit, format, build, export) MUST first invoke the /slidev skill and read its references at ~/.claude/skills/slidev/.

Project Structure

index.html              # Landing page (lists all decks)
decks/
  <deck-name>/
    slides.md             # Slide entry point
    pages/                # Additional slide files (imported via src: ./pages/xxx.md)
    public/               # Static assets (images, fonts)
scripts/
  build.sh                # Build all decks
.gitea/workflows/         # CI/CD pipeline
dist/                     # Build output (gitignored)

Each deck is an independent Slidev presentation under decks/. The build outputs to dist/<deck-name>/ with the landing page at dist/index.html.

Adding a New Deck

  1. Create directory: decks/<name>/
  2. Add decks/<name>/slides.md with frontmatter
  3. Optionally add pages/ and public/ subdirectories
  4. Register in index.html decks array
  5. Add dev:<name> and build:<name> scripts to package.json

Git Commit Convention

Use Conventional Commits (English):

type: description

feat: add new slide deck for React hooks
docs: update presenter notes for API talk
fix: correct Mermaid diagram rendering
chore: update Slidev dependencies

Types: feat, fix, docs, style, refactor, chore, build, ci

After completing slide edits, auto-commit with a descriptive message.

Key Commands

pnpm run dev           # Dev server for demo deck (http://localhost:3030)
pnpm run dev:<deck>    # Dev server for a specific deck
pnpm run build         # Build all decks → dist/
pnpm run build:<deck>  # Build a single deck
pnpm run serve         # Build all + serve dist/ on port 3030 (landing page with deck selection)
pnpm run export        # Export to PDF (requires playwright-chromium)
  • dev mode — hot-reload single deck for editing, use pnpm run dev or pnpm run dev:<deck>
  • serve mode — build all decks and serve the landing page at http://localhost:3030, choose which deck to present

CI/CD Pipeline

  • Trigger: push to main branch
  • Runner: self-hosted Gitea Act Runner (label: aliyun), Docker mode with /var/run/docker.sock mounted
  • Steps: checkout → install deps → pnpm run build → deploy dist/ to nginx container
  • Deploy: CI job spawns a sibling nginx container on the host via the mounted Docker socket (Docker out of Docker, not DinD)
  • Serve: nginx container exposes port 8080, decks accessible at /<deck-name>/