A reusable Slidev template for building multiple presentation decks and publishing them as one static GitHub Pages site.
- Create a new repository from this template.
- Edit
decks/demo-one/slides.mdor add a new deck underdecks/. - Push to
main. - In GitHub, open
Settings->Pages, then setBuild and deploymenttoGitHub Actions.
- Node.js 22
- pnpm 11.6.0
If Corepack is available:
corepack enable
pnpm install
pnpm run skills:installPreview the full deck index with hot reload:
pnpm devThis starts a local index at http://localhost:3030/ and proxies each
discovered deck to its own Slidev dev server.
Preview a single deck by slug without the site proxy:
pnpm dev demo-onePass extra Slidev options after --:
pnpm dev demo-one -- --port 4040Build the full static site:
pnpm run buildPreview the existing static site output:
pnpm previewThe preview server listens on all network interfaces, so devices on the same
network can open the printed network URL. pnpm preview does not rebuild; run
pnpm run build first after changing slides.
pnpm run buildThe static site is generated in dist/.
The home page is generated at dist/index.html. Each deck is generated under
its configured public route:
dist/
├── index.html
├── 404.html
├── styles.css
├── demo-one.html
├── demo-one/
│ ├── index.html
│ └── assets/
├── demo-two.html
└── demo-two/
├── index.html
└── assets/
GitHub Pages uses:
pnpm run buildThe workflow sets BASE_PATH automatically:
https://<user>.github.io/repositories build with/- normal project repositories build with
/<repo-name>/
The generated site uses static file routes:
/opens the deck index./demo-one/opens the first demo deck when its route isdemo-one./demo-two/opens the second demo deck when its route isdemo-two./demo-oneand/demo-tworedirect to the matching trailing-slash route.- Unknown paths such as
/unknown,/demo-one/foo, and/demo-two/fooreturn 404. - Slide routes use hash URLs, such as
/demo-one/#/1, so page refreshes still request the real/demo-one/entry.
Each deck lives in decks/<slug>/:
decks/
├── demo-one/
│ ├── deck.json
│ └── slides.md
└── demo-two/
├── deck.json
└── slides.md
slides.md frontmatter provides the home page title and description:
---
title: "Demo Two"
info: |
A second demo deck that demonstrates multi-deck publishing.
---deck.json controls site-level sorting, visibility, and the optional public
route:
{
"$schema": "../../schemas/deck.schema.json",
"order": 2,
"visibility": "listed",
"route": "demo-two"
}- The directory name is the deck slug for commands, such as
pnpm dev demo-one. routeis optional and controls the public URL, Slidev base path, and build output directory. If omitted, it defaults to the directory slug.- For example,
decks/demo-one/deck.jsoncan set"route": "intro"so the command remainspnpm dev demo-one, while the public route is/intro/and the build output isdist/intro/. titleandinfofromslides.mdare shown on the home page.orderindeck.jsoncontrols home page sorting.visibilityindeck.jsonis optional and defaults tolisted:listedappears on the home page and in full-site dev/build.hiddenis skipped by full-site dev/build, but directpnpm dev <slug>andpnpm export <slug>still work.disabledis treated as unavailable, including direct deck commands.
To add another deck, copy decks/demo-two/ to decks/my-talk/, update
order, optional visibility, and optional route in deck.json, edit
title and info in slides.md, then run pnpm run build.
pnpm export demo-oneIf Chromium is missing, install it with:
pnpm exec playwright install chromiumThis template treats project skills like generated dependencies.
skills-lock.jsonis committed and is the source of truth..agents/skills/is generated locally and ignored by Git.- Restore skills manually after installing dependencies.
- CI does not install project skills because Slidev build does not need them.
Useful commands:
pnpm run skills:install
pnpm run skills:list
pnpm run skills:update.
├── decks/
│ ├── demo-one/
│ └── demo-two/
├── site/
│ ├── index.html
│ └── styles.css
├── schemas/
│ └── deck.schema.json
├── scripts/
│ └── build-site.mjs
├── package.json
├── pnpm-lock.yaml
├── skills-lock.json
└── .github/workflows/
└── deploy-pages.yml
- Edit slide content in
decks/<slug>/slides.md. - Edit deck title and description in
decks/<slug>/slides.mdfrontmatter. - Edit deck sort order and visibility in
decks/<slug>/deck.json. - Keep dependencies reproducible with
pnpm-lock.yaml. - Run
pnpm run buildbefore pushing meaningful slide changes. - Run
pnpm run skills:updatewhen intentionally refreshing project skills.