Closed Lruihao closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
fixit | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 26, 2023 8:52am |
0.3.0 迁移到
params.page.cacheRemoteImages
目前的思路虽然解决了图床图片无法获取高度导致懒加载时锚点跳转错位的问题,但是又带来了不少弊端,所以该配置为试验性功能,需要的自行开启:
# FixIt 0.3.0 | NEW [Experimental] cache remote images locally, see: https://github.com/hugo-fixit/FixIt/pull/362
# FixIt 0.3.0 | 新增 [试验性功能] 缓存图床图片到本地,详见:https://github.com/hugo-fixit/FixIt/pull/362
[params.page.cacheRemoteImages]
enable = false
# replace remote image url with local image url
# 用本地图片链接替换远程图片链接
replace = false
Why
With the
GetRemote
function provided by hugo and some robust matching methods, FixIt now can cache remote images locally. This feature mainly focus on adding height and width to remote images in markdown to prevent layout shifts, caching these images locally is more like an added benefit. The advantages and disadvantages of this feature are relatively obvious, so it will be offered as an option(off by default) to the user.Fixes #348
Pros
webp
format while resizing.Cons
Reference