-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
feat: make srcset
actually useful
#1170
Conversation
- Remove unnecessary code for handling image dimensions in `layouts/_default/summary.html` - Remove unnecessary code for handling image dimensions in `layouts/posts/single.html`
Someone is attempting to deploy a commit to a Personal Account owned by @HEIGE-PCloud on Vercel. @HEIGE-PCloud first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just revert the changes I made in cacheRemoteImages
pr, many other partial will use this hook, would be better to keep it "neutral".
layouts/partials/plugin/image.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid interfering with the images in the header and other sections, I have created two variables: Optim
and Remote
. To enable the corresponding functionality, you must explicitly set these variables to true.
The srcset optimization is now enabled in the following parts:
- markdown image render hook
- image shortcode
- summary image in single view
- summary image in list view.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
100vw is a reasonable default anyway
# [Experimental] cache remote images in markdown, more info: https://github.com/HEIGE-PCloud/DoIt/pull/860#issue-1574342372 | ||
# [试验性功能] 缓存图床图片,详情请见:https://github.com/HEIGE-PCloud/DoIt/pull/860#issue-1574342372 | ||
cacheRemoteImages = false | ||
cacheRemoteImages = true | ||
# [Experimental] generate image srcset attribute with hugo image processing feature. | ||
# [试验性功能] 使用 hugo 图片处理功能生成 srcset 属性 | ||
optimizeImages = true | ||
# [Experimental] resize method for srcset attribute in optimizeImages, more info: https://gohugo.io/content-management/image-processing/#image-processing-options | ||
# [实验性功能] optimizeImages 中 srcset 属性的缩放方法, 详情请见:https://gohugo.io/content-management/image-processing/#image-processing-options | ||
srcsetSmallResizeMethod = "700x webp Lanczos q75" | ||
srcsetDefaultResizeMethod = "1200x webp Lanczos q75" | ||
srcsetLargeResizeMethod = "2000x webp Lanczos q75" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be better if we moves these options under [page]
so there can be page level control using the front matter?
also fix #1168
will work on documentation after everything is settled.