Blog Slidev Workflow
Use the globally installed slidev skill for Slidev syntax, layouts, components, animation, and export details. Apply the repository-specific rules below for project structure and publishing.
Repository contract
- Store every deck as an independent pnpm project at
slides/<slug>/. - Use a lowercase kebab-case slug. Treat it as a permanent public identifier.
- Keep each deck's
package.json,pnpm-lock.yaml,slides.md, components, layouts, snippets, and public assets inside its own directory. - Do not add deck dependencies to the blog root
package.jsonand do not turn the repository into a pnpm workspace unless the user requests that migration. - Publish a deck at
/slides/<slug>/. GitHub Actions writes its static build topublic/slides/<slug>/after Hugo builds the blog. - Never commit generated
dist/,node_modules/, orpublic/output.
Create a deck
Confirm the requested title and derive a stable kebab-case slug.
Run:
.agents/skills/blog-slidev/scripts/create-deck.sh <slug> "<title>"Edit
slides/<slug>/slides.mdusing the officialslidevskill.Run
pnpm --dir slides/<slug> devfor local authoring.Run
pnpm --dir slides/<slug> exec slidev build --base /slides/<slug>/before handoff.
The creation script refuses to overwrite an existing directory, copies the bundled template, substitutes the slug/title, and runs pnpm install in the new deck.
Publish and verify
The Pages workflow must keep this order:
- Build Hugo into
public/. - Discover direct child directories under
slides/that containpackage.json. - Run
pnpm install --frozen-lockfilein each deck. - Build each deck with
pnpm --dir <deck> exec slidev build, base/slides/<slug>/, and outputpublic/slides/<slug>/. - Upload
public/once withactions/upload-pages-artifact.
When changing deployment logic, verify both Hugo output and at least one deck build. Ensure generated HTML references the deck's /slides/<slug>/ base rather than /.
Link or embed in Hugo
Prefer a normal link when full-screen presenting is the main experience:
[打开演示文稿](/slides/<slug>/)
Use the repository shortcode when the deck must appear inside an article:
{{</* slidev slug="<slug>" title="演示文稿标题" */>}}
The shortcode validates the slug before rendering an iframe. Do not replace it with raw HTML or enable Goldmark's global unsafe option.
Change checklist
- Preserve unrelated working-tree changes and follow the repository's commit rules.
- Update the deck's lockfile whenever dependencies change.
- Keep the public slug and build base identical.
- Run the skill validator after editing this skill.
- Report breaking path changes, compatibility configuration, verification commands, and the final public URL.