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: README.md
+36-62Lines changed: 36 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -20,72 +20,46 @@ Open the gatsby-config.js file from the root directory of your Gatsby project an
20
20
21
21
```javascript
22
22
// In your gatsby-config.js
23
-
plugins: [
24
-
{
25
-
resolve:`gatsby-source-contentstack`,
26
-
options: {
27
-
// Required: API Key is a unique key assigned to each stack.
28
-
api_key:`api_key`,
29
23
30
-
// Required: Delivery Token is a read-only credential.
31
-
delivery_token:`delivery_token`,
32
-
33
-
// Required: Environment where you published your data.
34
-
environment:`environment`,
35
-
36
-
// Optional: Specify branch name. Default it would fetch from "main".
37
-
branch:`branch name`,
38
-
39
-
// Optional: CDN set this to point to other cdn end point. For eg: https://eu-cdn.contentstack.com/v3
40
-
cdn:`cdn_url`,
41
-
42
-
// Recommended: Specify true if you want to fetch/source data parallelly. It enhances the performance on both gatsby build/develop command.
43
-
expediteBuild:`boolean_value`,
44
-
45
-
// Recommended: Specify true if you want to generate custom schema when the content type models are complex.
46
-
enableSchemaGeneration :`boolean_value`,
47
-
48
-
// Optional: Specify true if you want to generate optional graphql fields for mandatory Contentstack fields
49
-
disableMandatoryFields :`boolean_value`,
50
-
51
-
// Optional: Specify a different prefix for types. This is useful in cases where you have multiple instances of the plugin to be connected to different stacks.
52
-
type_prefix:`Contentstack`, // (default)
53
-
54
-
// Optional: Specify true if you want to download all your contentstack images locally
55
-
downloadImages:`boolean_value`,
56
-
57
-
// Optional: Specify the content types from which you want the plugin to retrieve data.
58
-
contentTypes: [‘blog’,’author’],
59
-
// This will fetch the data of the ‘blog’ and ‘author’ content types only.
60
-
61
-
// Optional: Specify the content types that the plugin should exclude while fetching data of all content types.
62
-
excludeContentTypes: [‘home’,’about’],
63
-
// This will fetch the data of all the available content types excluding the ‘home’ and ‘about’ content types.
64
-
65
-
// Optional: Include the locales that you want the plugin to fetch data from.
66
-
locales: [‘en-us’,’fr-fr’],
67
-
// In this case, the plugin will fetch only English (United States) and French (France) language data.
68
-
69
-
// Optional: Specify true to convert the JSON-RTE repsonse to HTML. Default it is set to false
70
-
jsonRteToHtml:false ,
71
-
72
-
// Optional: Specify a number to perform http-retries for network failures. By default it is set to 3.
73
-
httpRetries:2,
74
-
75
-
//Optional: Specify the number of entries/assets to be fetched per page. Maximum limit accepted is 100. By default it is set to 50.
76
-
limit:50
24
+
module.exports= {
25
+
plugins: [
26
+
{
27
+
resolve:`gatsby-source-contentstack`,
28
+
options: {
29
+
api_key:`api_key`,
30
+
delivery_token:`delivery_token`,
31
+
environment:`environment`,
32
+
}
33
+
}
34
+
]
35
+
};
36
+
// Note: access_token is replaced by delivery_token
37
+
```
77
38
78
-
//Optional: Specify the header to be passed to Contentstack API
79
-
enableEarlyAccessKey:'x-header-ea'
39
+
## Plugin Options
40
+
41
+
| Option | Required | Type | Description | Default | Example |
| type_prefix | Optional | string | Specify a different prefix for types. |`Contentstack`|`Contentstack_Stack_A`|
52
+
| downloadImages | Optional | boolean | Specify true to download all Contentstack images locally. |`false`|`true`|
53
+
| contentTypes | Optional | string[]| Specify the content types to retrieve data from. ||`[‘blog’,’author’]` This will fetch the data of the ‘blog’ and ‘author’ content types only. |
54
+
| excludeContentTypes | Optional | string[]| Specify the content types to exclude while fetching data. ||`[‘home’,’about’]` This will fetch the data of all the available content types excluding the ‘home’ and ‘about’ content types.|
55
+
| locales | no | string[]| Include the locales that you want to fetch data from. ||`[‘en-us’,’fr-fr’]` In this case, the plugin will fetch only English (United States) and French (France) language data. |
56
+
| jsonRteToHtml | no | boolean | Specify true to convert the JSON-RTE response to HTML. |`false`|`true`|
57
+
| httpRetries | no | number | Specify the number of HTTP retries for network failures. |`3`|`2`|
58
+
| limit | no | number | Specify the number of entries/assets per page (Max: 100). |`50`|`50`|
59
+
| enableEarlyAccessKey | no | string | Specify list of headers to be passed to Contentstack API for the key specified in enableEarlyAccessKey. The Value should be a string. In case of multiple headers, separate them with a comma. ||`'x-header-ea'`|
60
+
| enableEarlyAccessValue | no | string | Specify list of headers to be passed to Contentstack API for the key specified in enableEarlyAccessKey. The Value should be a string. In case of multiple headers, separate them with a comma: 'header1,header2' ||`'newcda,taxonomy'`|
80
61
81
-
//Optional: Specify list of headers to be passed to Contentstack API for the key specified in enableEarlyAccessKey. The Value should be a string. In case of multiple headers, separate them with a comma. For eg:'header1,header2'
82
-
enableEarlyAccessValue:'newcda,taxonomy'
83
62
84
-
},
85
-
},
86
-
]
87
-
// Note: access_token is replaced by delivery_token
88
-
```
89
63
90
64
There is a provision to speed up the `gatsby build` process. To do this, you can set the value of the **expediteBuild** to **true**. So when you set the value of this parameter to true, the build process is significantly enhanced as only published assets and entries are synced parallelly.
0 commit comments