slidevjs / slidev

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

run build and get the wrong background images path #1627

Closed lfire closed 5 months ago

lfire commented 5 months ago

Describe the bug image

To Reproduce Steps to reproduce the behavior:

  1. put the bg images in /public path
  2. config the slide theme and background like
    theme: seriph
    background: /public/bg/_966fd0c7-591b-499e-b472-5cdfad5eed4d.jpeg
  3. config the npm script build slidev build ai.md --out ./docs
  4. run build
  5. get the error path like the image desc

Desktop (please complete the following information):

KermanX commented 5 months ago

The frontmatter should be like:

background: /bg/_966fd0c7-591b-499e-b472-5cdfad5eed4d.jpeg

(No /public prefix)

lfire commented 5 months ago

@KermanX image when I work with multi entry in a repo, how can I set the backgroud path? If I config the backgroud like /bg/****, the resource will be error path. image

KermanX commented 5 months ago

I don't know why the dist looks like this. Please send a minimal reproduction.

lfire commented 5 months ago

I don't know why the dist looks like this. Please send a minimal reproduction.

Thx, I have resolved the problem by a shell. https://github.com/lfire/slidev-share/blob/main/build.sh