Slidev workflow

Build Slidev for a versioned reader path, then publish one stable URL

Use Slidesfly after Slidev has produced a static browser build and you want a deck-specific reader URL. Build with a relative base, add the opaque-origin storage fallback, zip the contents of dist so index.html is at the root, publish from an eligible Pro account, and verify the finished reader before sharing.

Author
Slidesfly
Reviewed by
Slidesfly maintainers
Published
Updated
Tested with
Slidev 52.18.1, a 49-file root-level archive, relative asset paths, an opaque-origin storage fallback, a byte-matched live reader, and slide navigation

11 minute workflow

When this Slidev hosting path fits

Use this workflow when Slidev is already your authoring tool and a deck-specific reader, same-URL updates, or public/unlisted sharing matters. Use GitHub Pages, Netlify, Vercel, or another general static host when you need to own the deployment project, serve arbitrary application behavior, or avoid Slidesfly's reader sandbox. Slidesfly does not edit or generate Slidev source.

Build Slidev with the verified base and reader helper

  1. Pin the verified dependency

    The proof fixture pins @slidev/cli 52.18.1 and commits its lockfile.
  2. Build for an unknown nested reader path

    Use --base ./. A root path such as /assets/ escapes the versioned deck directory and returns 404.
  3. Patch opaque-origin storage and navigation

    Copy the fixture's inject-slidesfly-reader-bridge.mjs helper into your workspace and run it after every build.
npm install --save-exact @slidev/cli@52.18.1 @slidev/theme-default@0.25.0
npx slidev build slides.md --base ./ --out dist
node ./inject-slidesfly-reader-bridge.mjs dist/index.html slidev
test -f dist/index.html

The helper adds an in-memory localStorage/sessionStorage fallback before Slidev's first module runs, without replacing real storage on a normal origin. It also installs the Slidesfly reader-navigation bridge. Use the exact helper from the verified source fixture.

Create a zip with index.html at the root

cd dist
zip -r ../slidev-deck.zip .
cd ..

# These must show index.html and relative ./assets references
unzip -l slidev-deck.zip | head
grep -Eo '(src|href)="[^"]+"' dist/index.html

The verified archive is 343,533 compressed bytes and 803,544 uncompressed bytes. Its index.html references ./favicon.svg and ./assets/…. It does not reference a root /assets/… path.

Publish the archive and keep the returned URL

slidesfly login --json
slidesfly publish ./slidev-deck.zip   --title "Slidev field guide"   --visibility unlisted   --json

A successful publish returns the generated deck ID and reader URL:

{
  "ok": true,
  "data": {
    "deck_id": "YOUR_GENERATED_DECK_ID",
    "url": "https://slidesfly.xyz/d/YOUR_GENERATED_DECK_ID",
    "visibility": "unlisted",
    "anonymous": false
  }
}

Rebuild and republish with --id YOUR_DECK_ID to update the same reader URL. Public indexing, expiry, deletion, and quarantine remain separate lifecycle policies.

Slidev compatibility checks

AreaVerified contractWhat to check
Base pathRelative ./ URLs stay below the versioned reader path.No root /assets references and no asset 404s.
StorageThe iframe has an opaque origin without normal persistent storage.The fallback runs before module scripts; navigation reaches slide 2.
Runtime codeRemote script sources are rejected; local relative modules are supported.Every runtime request stays inside the uploaded archive path.
Reader controlsSlidev's in-deck controls and the Slidesfly bridge both remain available.Keyboard, pointer, touch, fullscreen, fonts, and code highlighting.
sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms"

Slidev publishing failures and recovery

FailureRecovery
AUTH_REQUIREDRun the supported login flow, then retry the zip publish.
FORBIDDENUse an eligible Pro account and public or unlisted visibility.
INVALID_HTMLConfirm index.html is at the archive root and the archive stays within the current 50-file limit.
MALICIOUS_CONTENTBundle remote scripts locally or use Report for a reproducible false positive.
Blank reader or storage errorRebuild with --base ./, rerun the helper, and inspect failed requests.

Slidev 52.18.1 live proof

The repository and reader index.html files are both 3,596 bytes with SHA-256 03e4d5ee614917178784854b1775c73066f4610127bdddbac022a1b1ef7fbad4. Browser verification advanced the production deck from slide 1 to slide 2 and loaded its declared runtime assets from the versioned reader path.