This repository has been archived by the owner on Jun 15, 2020. It is now read-only.
generated from styxlab/gatsby-starter-try-ghost
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
84 lines (78 loc) · 2.39 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
const path = require(`path`)
let siteConfig
let ghostConfig
let routesConfig
try {
siteConfig = require(`./siteConfig`)
} catch (e) {
siteConfig = 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: [
{
resolve: `gatsby-theme-try-ghost`,
options: {
ghostConfig: ghostConfig,
siteConfig: siteConfig,
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: true,
// 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`
) && node.slug !== `data-schema`,
plugins: [
{
resolve: `gatsby-rehype-ghost-links`,
},
{
resolve: `gatsby-rehype-prismjs`,
},
],
},
},
],
}