feat: restructure project for multi-deck support
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Slide Project
|
||||
|
||||
Slidev presentation project. Remote Gitea repo with Docker-based CI/CD auto-deployment.
|
||||
Multi-deck Slidev presentation project. Remote Gitea repo with Docker-based CI/CD auto-deployment.
|
||||
|
||||
## Slidev Skill
|
||||
|
||||
@@ -8,11 +8,28 @@ All slide-related operations (create, edit, format, build, export) MUST first in
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `slides.md` — main slide entry point
|
||||
- `pages/` — additional slide files (imported via `src: ./pages/xxx.md`)
|
||||
- `public/` — static assets (images, fonts)
|
||||
- `.gitea/workflows/deploy.yaml` — CI/CD pipeline
|
||||
- `dist/` — build output (gitignored)
|
||||
```
|
||||
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
|
||||
|
||||
@@ -34,15 +51,17 @@ After completing slide edits, auto-commit with a descriptive message.
|
||||
## Key Commands
|
||||
|
||||
```bash
|
||||
pnpm run dev # Local dev server (http://localhost:3030)
|
||||
pnpm run build # Build static SPA → dist/
|
||||
pnpm run export # Export to PDF (requires playwright-chromium)
|
||||
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 export # Export to PDF (requires playwright-chromium)
|
||||
```
|
||||
|
||||
## 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 → `slidev build` → deploy dist/ to nginx container
|
||||
- **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
|
||||
- **Serve:** nginx container exposes port 8080, decks accessible at `/<deck-name>/`
|
||||
|
||||
Reference in New Issue
Block a user