@@ -100,10 +100,10 @@ You should now see the following dependencies in your `site/package.json`:
100
100
``` json:title=site/package.json
101
101
{
102
102
"dependencies" : {
103
- "gatsby" : " ^3.0.0 " ,
103
+ "gatsby" : " ^4.15.1 " ,
104
104
"gatsby-theme-events" : " *" ,
105
- "react" : " ^17.0 .0" ,
106
- "react-dom" : " ^17.0 .0"
105
+ "react" : " ^18.1 .0" ,
106
+ "react-dom" : " ^18.1 .0"
107
107
}
108
108
}
109
109
```
@@ -142,9 +142,9 @@ The `gatsby-theme-events/package.json` file should now include the following:
142
142
``` json:title=gatsby-theme-events/package.json
143
143
{
144
144
"peerDependencies" : {
145
- "gatsby" : " ^3.0.0 " ,
146
- "react" : " ^17.0 .0" ,
147
- "react-dom" : " ^17.0 .0"
145
+ "gatsby" : " ^4.15.1 " ,
146
+ "react" : " ^18.1 .0" ,
147
+ "react-dom" : " ^18.1 .0"
148
148
}
149
149
}
150
150
```
@@ -224,7 +224,7 @@ module.exports = {
224
224
{
225
225
resolve: " gatsby-source-filesystem" ,
226
226
options: {
227
- path: " data" ,
227
+ path: ` ${ __dirname } / data/ ` ,
228
228
},
229
229
},
230
230
{
@@ -272,7 +272,7 @@ const fs = require("fs")
272
272
273
273
// Make sure the data directory exists
274
274
exports .onPreBootstrap = ({ reporter }) => {
275
- const contentPath = " data"
275
+ const contentPath = ` ${ __dirname } / data/ `
276
276
277
277
if (! fs .existsSync (contentPath)) {
278
278
reporter .info (` creating the ${ contentPath} directory` )
@@ -296,7 +296,7 @@ const fs = require("fs")
296
296
297
297
// Make sure the data directory exists
298
298
exports .onPreBootstrap = ({ reporter }) => {
299
- const contentPath = " data"
299
+ const contentPath = ` ${ __dirname } / data/ `
300
300
301
301
if (! fs .existsSync (contentPath)) {
302
302
reporter .info (` creating the ${ contentPath} directory` )
@@ -337,7 +337,7 @@ const fs = require("fs")
337
337
338
338
// Make sure the data directory exists
339
339
exports .onPreBootstrap = ({ reporter }) => {
340
- const contentPath = " data"
340
+ const contentPath = ` ${ __dirname } / data/ `
341
341
342
342
if (! fs .existsSync (contentPath)) {
343
343
reporter .info (` creating the ${ contentPath} directory` )
@@ -985,7 +985,7 @@ Update the `gatsby-theme-events/gatsby-config.js` to accept options:
985
985
986
986
``` javascript:title=gatsby-theme-events/gatsby-config.js
987
987
// highlight-next-line
988
- module .exports = ({ contentPath = " data" , basePath = " /" }) => ({
988
+ module .exports = ({ contentPath = ` ${ __dirname } / data/ ` , basePath = " /" }) => ({
989
989
plugins: [
990
990
{
991
991
resolve: " gatsby-source-filesystem" ,
@@ -1004,7 +1004,7 @@ module.exports = ({ contentPath = "data", basePath = "/" }) => ({
1004
1004
})
1005
1005
```
1006
1006
1007
- The ` contentPath ` will default to " data" , and the ` basePath ` will default to the root, "/".
1007
+ The ` contentPath ` will default to ` ${__dirname}/ data/ ` , and the ` basePath ` will default to the root, "/".
1008
1008
1009
1009
In ` gatsby-node.js ` , the options that were added to the ` gatsby-config.js ` function are provided as a second argument to Gatsby's API hooks.
1010
1010
@@ -1013,7 +1013,7 @@ Update the `contentPath` to use the option set in `gatsby-config.js`:
1013
1013
``` javascript:title=gatsby-theme-events/gatsby-node.js
1014
1014
// highlight-start
1015
1015
exports .onPreBootstrap = ({ reporter }, options ) => {
1016
- const contentPath = options .contentPath || " data"
1016
+ const contentPath = options .contentPath || ` ${ __dirname } / data/ `
1017
1017
// highlight-end
1018
1018
1019
1019
// {...}
@@ -1097,7 +1097,7 @@ yarn workspace gatsby-theme-events add gatsby-plugin-theme-ui theme-ui
1097
1097
Then, add the ` gatsby-plugin-theme-ui ` plugin to the ` gatsby-theme-events/gatsby-config.js ` file:
1098
1098
1099
1099
``` javascript:title=gatsby-theme-events/gatsby-config.js
1100
- module .exports = ({ contentPath = " data" , basePath = " /" }) => ({
1100
+ module .exports = ({ contentPath = ` ${ __dirname } / data/ ` , basePath = " /" }) => ({
1101
1101
plugins: [
1102
1102
// highlight-next-line
1103
1103
" gatsby-plugin-theme-ui" ,
0 commit comments