You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/gatsby-plugin-image/README.md
+7-9
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,15 @@
2
2
3
3
This plugin is a replacement for gatsby-image. It adds [static images](#static-images), and a [new higher-performance gatsby-image component](#gatsby-image-next-generation).
4
4
5
-
This package is in alpha, and the API will change. It is not ready for production use yet.
5
+
This package is in alpha, and the API will change. It is not ready for production use yet, but feedback would be great.
6
6
7
7
## Usage
8
8
9
-
Install `gatsby-plugin-image`, then add it to your `gatsby-config.js`.
9
+
Install `gatsby-plugin-image` and `gatsby-plugin-sharp`, then add them to your `gatsby-config.js`. Upgrade `gatsby` to at least `2.24.78`.
10
10
11
11
# Static images
12
12
13
-
The [gatsby-image](https://www.gatsbyjs.org/packages/gatsby-image/) component, combined with the sharp plugin, is a great way to automatically resize and optimize your images and serve them in the most performant way. This plugin is a proof of concept for a simpler way to use Gatsby's image processing tools without needing to write GraphQL queries. It is designed for static images such as logos rather than ones loaded dynamically from a CMS.
13
+
This plugin is a proof of concept for a simpler way to use Gatsby's image processing tools and components without needing to write GraphQL queries. It is designed for static images such as logos rather than ones loaded dynamically from a CMS.
14
14
15
15
The current way to do this is with `useStaticQuery`:
16
16
@@ -58,8 +58,6 @@ export const Dino = () => (
58
58
<StaticImage
59
59
src="trex.png"
60
60
base64={false}
61
-
fluid
62
-
webP
63
61
grayscale
64
62
maxWidth={200}
65
63
alt="T-Rex"
@@ -109,7 +107,7 @@ The props must be able to be statically-analyzed at build time. You can't pass t
109
107
//Doesn't work
110
108
() => {
111
109
constwidth=getTheWidthFromSomewhere();
112
-
return<Img src="trex-png" width={width}>
110
+
return<Img src="trex.png" width={width}>
113
111
}
114
112
```
115
113
@@ -119,7 +117,7 @@ You can use variables and expressions if they're in the scope of the file, e.g.:
The only required prop is `src`. The default type is `fixed`.
156
+
The only required prop is `src`. The default type is `fixed`. The other props match those of [the new GatsbyImage component](#gatsby-image-next-generation)
0 commit comments