-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
77 lines (76 loc) · 1.98 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
module.exports = (options) => {
const { assetPath, basePath, collections } = options
if (!assetPath) {
throw "Please specify `assetPath` in the plugin options."
}
if (!basePath) {
throw "Please specify `basePath` in the plugin options."
}
if (!collections) {
throw "Please specify at least one collection."
}
return {
plugins: [
{
resolve: `gatsby-transformer-json`,
options: {
typeName: ({ node, object, isArray }) =>
`${node.sourceInstanceName}CategoriesJson`,
},
},
"gatsby-plugin-react-helmet",
"gatsby-transformer-sharp",
"gatsby-plugin-sharp",
{
resolve: "gatsby-plugin-mdx",
options: {
extensions: [".mdx", ".md"],
gatsbyRemarkPlugins: [
{
resolve: "gatsby-remark-images",
options: {
// should this be configurable by the end-user?
maxWidth: 1380,
linkImagesToOriginal: false,
},
},
{ resolve: "gatsby-remark-copy-linked-files" },
{ resolve: "gatsby-remark-smartypants" },
],
remarkPlugins: [require("remark-slug")],
},
},
{
resolve: "gatsby-plugin-favicon",
options: {
logo: "./src/favicon.png",
icons: {
android: true,
appleIcon: true,
appleStartup: false,
coast: false,
favicons: true,
firefox: true,
yandex: false,
windows: false,
},
},
},
{
resolve: "gatsby-source-filesystem",
options: {
path: `${basePath}/${assetPath}`,
name: assetPath,
},
},
].concat(
collections.map((collection) => ({
resolve: "gatsby-source-filesystem",
options: {
path: `${basePath}/${collection}`,
name: collection,
},
}))
),
}
}