-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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(v2): @docusaurus/plugin-ideal-image #1665
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 2c2c5c6 |
Deploy preview for docusaurus-preview ready! Built with commit 2c2c5c6 |
@@ -14,14 +14,14 @@ function Image(props) { | |||
{...props} | |||
alt={alt} | |||
className={className} | |||
height={img.src.height} | |||
height={img.src.height || 100} |
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.
in case someone wonders the hardcoded 100 value.
This is just to not throw error in dev because height and weight is a required field for react-ideal-image
see https://github.com/endiliey/responsive-loader#options
Disable processing of images by this loader (useful in development). srcSet and other attributes will still be generated but only for the original size. Note that the width and height attributes will both be set to 100 but the image will retain its original dimensions.
<div class="avatar__intro margin-left--none"> | ||
<h4 class="avatar__name">{user.title}</h4> | ||
<small class="avatar__subtitle"> | ||
<div className="avatar"> |
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.
fix class -> className
Motivation
Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder)
Close #928
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
Lazy loading and blurred placeholder
Generate no of responsive images depends on option
doesnt emit twice on client n server
https://github.com/endiliey/responsive-loader
The fork also had passing test case, original test cases are failing