Skip to content

Commit 45b42a0

Browse files
committed
docs: update examples
1 parent 48428e0 commit 45b42a0

File tree

8 files changed

+428
-381
lines changed

8 files changed

+428
-381
lines changed

examples/basic/gatsby-config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ module.exports = {
88
// https://drive.google.com/drive/folders/1YJWX_FRoVusp-51ztedm6HSZqpbJA3ag
99
folder: "1YJWX_FRoVusp-51ztedm6HSZqpbJA3ag",
1010
createPages: true,
11+
skipImages: false,
1112
},
1213
},
14+
"gatsby-plugin-image",
1315
"gatsby-plugin-sharp",
1416
"gatsby-transformer-sharp",
1517
{

examples/basic/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
"token": "../../utils/generate-token.js"
1111
},
1212
"dependencies": {
13-
"gatsby": "^4.0.1",
13+
"gatsby": "^4.1.4",
1414
"gatsby-image": "^3.11.0",
15-
"gatsby-plugin-sharp": "^4.0.1",
16-
"gatsby-remark-gifs": "^1.0.0",
17-
"gatsby-remark-images": "^6.0.0",
15+
"gatsby-plugin-image": "^2.1.2",
16+
"gatsby-plugin-sharp": "^4.1.3",
17+
"gatsby-remark-gifs": "^1.1.0",
18+
"gatsby-remark-images": "^6.1.3",
1819
"gatsby-remark-unwrap-images": "^1.0.2",
19-
"gatsby-transformer-remark": "^5.0.0",
20-
"gatsby-transformer-sharp": "^4.0.0",
20+
"gatsby-transformer-remark": "^5.1.3",
21+
"gatsby-transformer-sharp": "^4.1.0",
2122
"react": "link:../../node_modules/react",
2223
"react-dom": "link:../../node_modules/react-dom"
2324
}

examples/basic/src/templates/page.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Link, graphql} from "gatsby"
2-
import Img from "gatsby-image"
2+
import {GatsbyImage, getImage} from "gatsby-plugin-image"
33
import React from "react"
44

55
const TemplatePage = ({
@@ -22,7 +22,7 @@ const TemplatePage = ({
2222
Add an image in your Google Doc first page header
2323
https://support.google.com/docs/answer/86629
2424
*/}
25-
{cover && <Img fluid={cover.image.childImageSharp.fluid} />}
25+
{cover && <GatsbyImage image={getImage(cover.image)} />}
2626
<div dangerouslySetInnerHTML={{__html: html}} />
2727
</>
2828
)
@@ -37,9 +37,7 @@ export const pageQuery = graphql`
3737
cover {
3838
image {
3939
childImageSharp {
40-
fluid(maxWidth: 500, quality: 100) {
41-
...GatsbyImageSharpFluid
42-
}
40+
gatsbyImageData
4341
}
4442
}
4543
}

examples/basic/yarn.lock

Lines changed: 163 additions & 134 deletions
Large diffs are not rendered by default.

examples/website/gatsby-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module.exports = {
4444
"gatsby-plugin-eslint",
4545
"gatsby-plugin-layout",
4646
"gatsby-plugin-theme-ui",
47+
"gatsby-plugin-image",
4748
"gatsby-plugin-sharp",
4849
"gatsby-transformer-sharp",
4950
"gatsby-plugin-mdx-embed",

examples/website/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@
1212
"dependencies": {
1313
"@mdx-js/mdx": "^1.6.22",
1414
"@mdx-js/react": "^1.6.22",
15-
"gatsby": "^4.0.1",
16-
"gatsby-plugin-catch-links": "^4.0.0",
17-
"gatsby-plugin-eslint": "^4.0.0",
18-
"gatsby-plugin-image": "^2.0.0",
19-
"gatsby-plugin-layout": "^3.0.0",
20-
"gatsby-plugin-mdx": "^3.0.0",
15+
"gatsby": "^4.1.4",
16+
"gatsby-plugin-catch-links": "^4.1.0",
17+
"gatsby-plugin-eslint": "^4.0.2",
18+
"gatsby-plugin-image": "^2.1.2",
19+
"gatsby-plugin-layout": "^3.1.0",
20+
"gatsby-plugin-mdx": "^3.1.3",
2121
"gatsby-plugin-mdx-embed": "^0.0.22",
2222
"gatsby-plugin-react-svg": "^3.1.0",
23-
"gatsby-plugin-sharp": "^4.0.1",
24-
"gatsby-plugin-theme-ui": "^0.11.3",
23+
"gatsby-plugin-sharp": "^4.1.3",
24+
"gatsby-plugin-theme-ui": "^0.12.0",
2525
"gatsby-plugin-webfonts": "^2.1.1",
26-
"gatsby-remark-gifs": "^1.0.0",
27-
"gatsby-remark-images": "^6.0.0",
28-
"gatsby-remark-prismjs": "^6.0.0",
26+
"gatsby-remark-gifs": "^1.1.0",
27+
"gatsby-remark-images": "^6.1.3",
28+
"gatsby-remark-prismjs": "^6.1.0",
2929
"gatsby-remark-unwrap-images": "^1.0.2",
30-
"gatsby-transformer-remark": "^5.0.0",
31-
"gatsby-transformer-sharp": "^4.0.0",
30+
"gatsby-transformer-remark": "^5.1.3",
31+
"gatsby-transformer-sharp": "^4.1.0",
3232
"mdx-embed": "^0.0.22",
3333
"prismjs": "^1.25.0",
3434
"react": "link:../node_modules/react",
3535
"react-dom": "link:../node_modules/react-dom",
3636
"react-icons": "^4.3.1",
37-
"theme-ui": "^0.11.3"
37+
"theme-ui": "^0.12.0"
3838
},
3939
"devDependencies": {
4040
"eslint-loader": "^4.0.2",

examples/website/src/gatsby-plugin-theme-ui/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const theme = {
5151
styles: {
5252
root: {
5353
backgroundImage: gradientBackground,
54-
margin: [2, 3],
54+
padding: [2, 3],
5555
fontFamily: "Quicksand",
5656
},
5757
a: {

0 commit comments

Comments
 (0)