-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
55 lines (48 loc) · 1.83 KB
/
gatsby-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.com/docs/gatsby-config/
*/
require("dotenv").config({
path: ".env",
})
const SLICKNODE_ENDPOINT = process.env.SLICKNODE_ENDPOINT
if (!SLICKNODE_ENDPOINT) {
throw new Error(
"SLICKNODE_ENDPOINT not set in env variables. " +
"Please run `npm run setup` to create and connect a Slicknode API, or add the endpoint to your .env files"
)
}
module.exports = {
/* Your site config here */
plugins: [
{
resolve: "gatsby-source-slicknode",
options: {
// Endpoint to your Slicknode GraphQL API (Required)
endpoint: SLICKNODE_ENDPOINT,
// Download all images and add a localFile field to the slicknode `Image` types.
// The file can then be used in combination with gatsby-transformer-sharp and gatsby-image
// Default: true
downloadImages: true,
// If true, loads the content in preview mode.
// default: false
preview: false,
// Path to the directory where the Slicknode stores fragments of the individual types
// Those can then be customized to add or exclude specific fields from the nodes that are
// added to the gatsby store, add filtered connections etc.
// If you are using multiple Slicknode APIs in the same projects, use differnet paths for each project
// Default: slicknode-fragments
fragmentsPath: "slicknode-fragments",
// The prefix for typenames of the types that are added to the Gatsby GraphQL schema
// If you are using multiple gatsby-source-slicknode plugin instances, use different namespaces for
// each instance.
// Default: Slicknode_
typePrefix: "Slicknode_",
},
},
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
"gatsby-plugin-sass",
],
}