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

这次更新好像封面图有问题 #28

Open
king-zhangbn opened this issue Dec 4, 2024 · 5 comments · May be fixed by #35
Open

这次更新好像封面图有问题 #28

king-zhangbn opened this issue Dec 4, 2024 · 5 comments · May be fixed by #35
Labels
bug Something isn't working

Comments

@king-zhangbn
Copy link

由于更换coverImage到heroImage,我的很多图片全部炸了,但是换好后,不能支持url的图片了,报错如下
image
之前3.1.3版本都是可以正常的。

@king-zhangbn king-zhangbn changed the title 这次更新好像有很多小问题出现 这次更新好像封面图有问题 Dec 4, 2024
@cworld1
Copy link
Owner

cworld1 commented Dec 4, 2024

你的意思是 heroImage 使用远程图片吗?可以先copy一下之前的v3.1.3 Hero.astro 那个图片相关的代码, v3.1.5 或者 v3.1.6 我会更换设定为官方新的推荐collection image settings配置方案,届时应该能彻底解决(heroImage 相关问题自从4月我创建主题以来就没彻底解决过,希望新的官方推荐方案能彻底解决)

@cworld1 cworld1 linked a pull request Dec 4, 2024 that will close this issue
@cworld1 cworld1 added the bug Something isn't working label Dec 4, 2024
@cworld1
Copy link
Owner

cworld1 commented Dec 4, 2024

@king-zhangbn 对了,还有一个推荐解决办法,使用远程图像优化方案,不知道有没用,但是非常推荐。

https://astro-theme-pure.vercel.app/docs/advanced/optimize#adapt-external-images

@king-zhangbn
Copy link
Author

噢噢,好的

@cworld1
Copy link
Owner

cworld1 commented Dec 7, 2024

下次更新将修改填入图片heroImage识别格式,不排除可能仍会有问题。如有问题还请继续反馈。

@cworld1 cworld1 closed this as completed Dec 7, 2024
@cworld1
Copy link
Owner

cworld1 commented Jan 4, 2025

将在下个版本(v4.0.2)解决。使用方法:

heroImage:
  { src: 'https://img.tukuppt.com/ad_preview/00/15/09/5e715a320b68e.jpg!/fw/980', inferSize: true }

其中新选项 inferSize 为远程图像自动赋予宽高。如需手动指定,可将 inferSize 替换为对应的 width、height。

@cworld1 cworld1 reopened this Jan 4, 2025
@cworld1 cworld1 removed a link to a pull request Jan 4, 2025
@cworld1 cworld1 linked a pull request Jan 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants