-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
104 lines (97 loc) · 2.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
const path = require(`path`)
let siteConfig
let ghostConfig
let mediaConfig
let routesConfig
try {
siteConfig = require(`./siteConfig`)
} catch (e) {
siteConfig = null
}
try {
mediaConfig = require(`./mediaConfig`)
} catch (e) {
mediaConfig = null
}
try {
routesConfig = require(`./routesConfig`)
} catch (e) {
routesConfig = null
}
try {
ghostConfig = require(`./.ghost`)
} catch (e) {
ghostConfig = {
development: {
apiUrl: process.env.GHOST_API_URL,
contentApiKey: process.env.GHOST_CONTENT_API_KEY,
},
production: {
apiUrl: process.env.GHOST_API_URL,
contentApiKey: process.env.GHOST_CONTENT_API_KEY,
},
}
} finally {
const { apiUrl, contentApiKey } = process.env.NODE_ENV === `development` ? ghostConfig.development : ghostConfig.production
if (!apiUrl || !contentApiKey || contentApiKey.match(/<key>/)) {
ghostConfig = null //allow default config to take over
}
}
module.exports = {
plugins: [
`gatsby-plugin-preact`,
`gatsby-plugin-netlify`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: path.join(__dirname, `src`, `images`),
name: `images`,
},
},
{
resolve: `gatsby-theme-try-ghost`,
options: {
ghostConfig: ghostConfig,
siteConfig: siteConfig,
mediaConfig: mediaConfig,
routes: routesConfig,
},
},
{
resolve: `gatsby-theme-ghost-dark-mode`,
options: {
// Set to true if you want your theme to default to dark mode (default: false)
// Note that this setting has an effect only, if
// 1. The user has not changed the dark mode
// 2. Dark mode is not reported from OS
defaultModeDark: false,
// If you want the defaultModeDark setting to take precedence
// over the mode reported from OS, set this to true (default: false)
overrideOS: false,
},
},
{
resolve: `gatsby-theme-ghost-members`,
},
{
resolve: `gatsby-transformer-rehype`,
options: {
filter: node => (
node.internal.type === `GhostPost` ||
node.internal.type === `GhostPage`
),
plugins: [
{
resolve: `gatsby-rehype-ghost-links`,
},
{
resolve: `gatsby-rehype-prismjs`,
},
],
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// This plugin is currently causing issues: https://github.com/gatsbyjs/gatsby/issues/25360
//`gatsby-plugin-offline`,
],
}