slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
32.82k stars 1.33k forks source link

Base Route + Output Folder Issues #1796

Closed susmitpy closed 2 months ago

susmitpy commented 2 months ago

Describe the bug

I want to create a github repo consisting of presentations of my talks. I intend to use GitHub pages feature for it. Say I have a pres1.md file . I want it to be built in /docs/pres1 route so that I can setup GitHub pages from docs folder.

Minimal reproduction

Steps to reproduce the behavior:

  1. Run npm exec slidev build pres1.md --base /pres1/ --out docs

Issues:

  1. docs folder is not created
  2. If tried without out option, After the build, the cli asks a weird prompt: Entry file "/pres1" does not exist, do you want to create it?
    • Saying no, completes the process, but upon visiting route /pres1 , for all files 404 error is thrown (as it is accessing "/" directly
      ::1 - - [03/Aug/2024 17:50:32] "GET / HTTP/1.1" 200 -
      ::1 - - [03/Aug/2024 17:50:34] "GET /pres1/ HTTP/1.1" 200 -
      ::1 - - [03/Aug/2024 17:50:34] code 404, message File not found
      ::1 - - [03/Aug/2024 17:50:34] "GET /assets/monaco/bundled-types-BcFG8S89.css HTTP/1.1" 404 -
      ::1 - - [03/Aug/2024 17:50:34] code 404, message File not found
      ::1 - - [03/Aug/2024 17:50:34] "GET /assets/modules/shiki-BPvBenZD.css HTTP/1.1" 404 -
      ::1 - - [03/Aug/2024 17:50:34] code 404, message File not found
      ::1 - - [03/Aug/2024 17:50:34] "GET /assets/modules/file-saver-igGfcqei.js HTTP/1.1" 404 -
      ::1 - - [03/Aug/2024 17:50:34] code 404, message File not found
      ::1 - - [03/Aug/2024 17:50:34] code 404, message File not found
      ::1 - - [03/Aug/2024 17:50:34] "GET /assets/monaco/bundled-types-C1BxkWR2.js HTTP/1.1" 404 -
      ::1 - - [03/Aug/2024 17:50:34] code 404, message File not found
      ::1 - - [03/Aug/2024 17:50:34] code 404, message File not found
      ::1 - - [03/Aug/2024 17:50:34] "GET /assets/index-Ckfp09MG.js HTTP/1.1" 404 -
      ::1 - - [03/Aug/2024 17:50:34] code 404, message File not found
      ::1 - - [03/Aug/2024 17:50:34] "GET /assets/index-DD92WybB.css HTTP/1.1" 404 -
      ::1 - - [03/Aug/2024 17:50:34] "GET /assets/modules/vue-CNV5Fodj.js HTTP/1.1" 404 -
      ::1 - - [03/Aug/2024 17:50:34] "GET /assets/modules/shiki-CkjltbPk.js HTTP/1.1" 404 -
    • Saying yes, gives the below error
      Error: EROFS: read-only file system, copyfile '/Users/susmitvengurlekar/projects/talks/node_modules/@slidev/cli/template.md' -> '/pres1'
      at Module.copyFileSync (node:fs:3003:11)
      at resolveEntry (file:///Users/susmitvengurlekar/projects/talks/node_modules/@slidev/cli/dist/chunk-HOVIRHCR.js:67:10)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async resolveOptions (file:///Users/susmitvengurlekar/projects/talks/node_modules/@slidev/cli/dist/chunk-XYLYAM2E.js:8224:17)
      at async Object.handler (file:///Users/susmitvengurlekar/projects/talks/node_modules/@slidev/cli/dist/cli.js:340:23) {
      errno: -30,
      code: 'EROFS',
      syscall: 'copyfile',
      path: '/Users/susmitvengurlekar/projects/talks/node_modules/@slidev/cli/template.md',
      dest: '/pres1'
      }

Environment

KermanX commented 2 months ago

Try npm exec slidev build pres1.md -- --base /pres1/ --out docs?

susmitpy commented 2 months ago

@KermanX Your command generated the docs folder , but there was no pres1 folder in it. As a result, the slideshow was not present at / neither at /pres1

However, npm exec slidev build pres1.md -- --base /pres1/ --out docs/pres1 did the trick Thanks

The double -- is missing from the documentation.