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

gitee pages 部分资源加载不出来 #15

Closed
2333Ge opened this issue Jul 2, 2022 · 3 comments
Closed

gitee pages 部分资源加载不出来 #15

2333Ge opened this issue Jul 2, 2022 · 3 comments

Comments

@2333Ge
Copy link

2333Ge commented Jul 2, 2022

当部署到形如 https://foo.github.io/bar/ 的pages上时,图片资源加载不出来

官网查到这个描述,

如果你打算将你的网站部署到 https://foo.github.io/bar/,那么 base 的值就应该被设置为 "/bar/" (应当总是以斜杠开始,并以斜杠结束)。

有了基础路径(Base URL),如果你希望引用一张放在 .vuepress/public 中的图片,你需要使用这样路径:/bar/image.png,然而,一旦某一天你决定去修改 base,这样的路径引用将会显得异常脆弱。为了解决这个问题,VuePress 提供了内置的一个 helper $withBase(它被注入到了 Vue 的原型上),可以帮助你生成正确的路径:

在对应文件加上withbase后能加载出来了

目前发现的加载不出来资源的地方有:首页图片、tags汇总页跳转链接、文章主页头部图片

@80maker
Copy link
Owner

80maker commented Jul 2, 2022

感谢反馈,之前没考虑到path的这种情形,修复后会发布个小版本。

@80maker
Copy link
Owner

80maker commented Jul 2, 2022

已在1.2.2版本修复;

@80maker 80maker closed this as completed Jul 3, 2022
@2333Ge
Copy link
Author

2333Ge commented Jul 11, 2022

已在1.2.2版本修复;

老板,还是有点问题

首页图片能加载出来,进入文章后头图就加载不出来了
这是我现在部署的地址:

https://i2333g3.gitee.io/personal-learning-blog/post/2022/04/21/shell.html

左侧头像加载不出
从首页文章页后,刷新地址变成了:https://i2333g3.gitee.io/personal-learning-blog/post/2022/04/21/logo.jpg

应该是 https://i2333g3.gitee.io/personal-learning-blog/logo.jpg

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