vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.22k stars 2.13k forks source link

Github页面部署后图片与icon无法加载,本地可以正常显示 #4203

Closed Mskins closed 2 months ago

Mskins commented 2 months ago

Describe the bug

Github页面部署后图片与icon无法加载,本地可以正常显示。 I am encountering an issue where images and icons cannot be loaded after deploying to GitHub Pages. These images and icons display correctly when viewed locally.

Reproduction

no

Expected behavior

I want to know where the problem lies.

System Info

win11,edge

Additional context

PixPin_2024-09-15_23-32-49

Validations

brc-dd commented 2 months ago

Try running vitepress build command and preview command locally. It should show broken images too. Most likely you need to move your images referenced from frontmatter to the public directory. If it works locally with vitepress preview, please share how you're deploying the site.

Mskins commented 2 months ago

OK,thank you.The problem has been solved.