-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgatsby-config.js
217 lines (217 loc) · 7.74 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
module.exports = {
pathPrefix: `/docs`,
siteMetadata: {
title: `DrupalConsole site`,
description: `DrupalConsole site, docs, cheatsheet`,
author: `@drupalconsole`,
siteUrl: 'https://drupalconsole.com'
},
mapping: {
"LanguagesYaml.authors": `AuthorsYaml`,
"ResourcesYaml.author": `AuthorsYaml`,
},
plugins: [
{
resolve: "gatsby-source-filesystem",
options: {
name: "assets",
path: `${__dirname}/content/assets/`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "articles",
path: `${__dirname}/content/articles/`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "changelog",
path: `${__dirname}/content/changelog/`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "docs",
path: `${__dirname}/content/docs/`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "pages",
path: `${__dirname}/content/pages/`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "data",
path: `${__dirname}/content/data/`,
},
},
`gatsby-transformer-yaml`,
`gatsby-transformer-json`,
'gatsby-transformer-remark',
{
resolve: `gatsby-plugin-mdx`,
options: {
extensions: [".mdx", ".md"],
gatsbyRemarkPlugins: [
{
resolve: "gatsby-remark-external-links",
options: {
target: "_blank",
rel: "nofollow noopener noreferrer external",
},
},
]
}
},
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: 'https://www.drupalconsole.com',
// sitemap: 'https://www.drupalconsole.com/sitemap.xml',
policy: [{ userAgent: '*', allow: '/' }]
}
},
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
display: `minimal-ui`,
icon: `src/images/drupal-console-icon.png`, // This path is relative to the root of the site.
},
},
{
resolve: 'gatsby-plugin-google-analytics',
options: {
trackingId: `UA-57046308-1`,
head: false,
anonymize: true,
respectDNT: true,
},
},
{
resolve: `gatsby-plugin-purgecss`,
options: {
printRejected: true, // Print removed selectors and processed file names
// develop: true, // Enable while using `gatsby develop`
// tailwind: true, // Enable tailwindcss support
whitelist: [
'nav-angle', 'float-right', 'float-left', 'active', 'dropdown-menu-right', 'react-autosuggest__suggestion',
'react-autosuggest__input','react-autosuggest__input--open','react-autosuggest__input--focused',
'react-autosuggest__suggestions-list', 'react-autosuggest__suggestions-container', 'react-autosuggest__suggestions-container--open',
'react-autosuggest__container', 'react-autosuggest__container--open',
'dropdown-menu-left', 'dropdown-sidebar', 'rtl', 'bl-1', 'pl-md-5', 'br-1', 'pr-md-5',
'dropdown-item', 'dropdown-menu', 'btn', 'btn-secondary','dropdown-toggle'
], // Don't remove this selector
whitelistPatterns: [/^dropdown/ ],
// ignore: ['/ignored.css', 'prismjs/', 'docsearch.js/'], // Ignore files/folders
// purgeOnly : ['static/css/'], // Purge only these files/folders
}
},
{
resolve: 'gatsby-plugin-lunr',
options: {
// ISO 639-1 language codes. See https://lunrjs.com/guides/language_support.html for details
languages: [
{
name: 'en',
filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'en',
},
{
name: 'es',
filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'es',
},
// {
// name: 'ca',
// filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'ca',
// },
// {
// name: 'fa-ir',
// filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'fa-ir',
// },
{
name: 'fr',
filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'fr',
},
// {
// name: 'hi',
// filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'hi',
// },
{
name: 'hu',
filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'hu',
},
{
name: 'ja',
filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'ja',
},
// {
// name: 'mr',
// filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'mr',
// },
// {
// name: 'pt-br',
// filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'pt-br',
// },
{
name: 'ro',
filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'ro',
},
{
name: 'ru',
filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'ru',
},
// {
// name: 'vn',
// filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'vn',
// },
// {
// name: 'zh-hans',
// filterNodes: node => node.fields && node.__gatsby_resolved.fileInfo.sourceInstanceName==='docs' && node.fields.language === 'zh-hans',
// },
],
// Fields to index. If store === true value will be stored in index file.
// Attributes for custom indexing logic. See https://lunrjs.com/docs/lunr.Builder.html for details
fields: [
{ name: 'content', store: true },
{ name: 'url', store: true },
{ name: 'title', store: true },
],
// A function for filtering nodes. () => true by default
// filterNodes: (node) => !isNil(node.rawBody),
// How to resolve each field's value for a supported node type
resolvers: {
// For any node of type MarkdownRemark, list how to resolve the fields' values
Mdx: {
content: (node) => node.rawBody,
url: (node) => node.fields.slug,
language:(node) => node.fields.language,
title:(node) => node.fields.title,
},
},
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
}