Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【vuepress】相对路径不添加"./"无法访问图片资源 #3062

Open
c-wchen opened this issue Jun 30, 2022 · 2 comments
Open

【vuepress】相对路径不添加"./"无法访问图片资源 #3062

c-wchen opened this issue Jun 30, 2022 · 2 comments

Comments

@c-wchen
Copy link

c-wchen commented Jun 30, 2022

Bug report

Steps to reproduce

图片资源和md文件存放同级目录assets下,通过assets/img.png无法访问,而通过./assets/img.png却能访问

What is expected?

图片访问同时支持assets/img.png相对路径方式访问

What is actually happening?

资源无法访问

Other relevant information

Environment Info:

  System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
  Binaries:
    Node: 12.9.1 - D:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.10.2 - D:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.37)
  npmPackages:
    @vuepress/core:  1.9.7
    @vuepress/theme-default:  1.9.7
    vuepress: ^1.9.7 => 1.9.7
  npmGlobalPackages:
    vuepress: Not Found
@ulivz
Copy link
Member

ulivz commented Jul 4, 2022

assets/img.png will be resolved to the public directory, you can put them inside .vuepress/public and they will be copied to the root of the generated directory.

ref: Asset Handling > Public Files

@c-wchen
Copy link
Author

c-wchen commented Jul 5, 2022

这样对于从其他平台迁移的博客是十分不友好的,可以考虑增加一个选项支持短路径模式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants