forked from DOI-ONRR/nrrd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
198 lines (194 loc) · 6 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
const fetch = require('isomorphic-fetch')
const { createHttpLink } = require('apollo-link-http')
const GOOGLE_ANALYTICS_ID = (process.env.CIRCLE_BRANCH === 'master') ? 'UA-33523145-1' : ''
const GTM_ID = (process.env.CIRCLE_BRANCH === 'master') ? 'GTM-NCRF98R' : ''
const config = {
siteMetadata: {
title: 'Natural Resources Revenue Data',
description:
// eslint-disable-next-line max-len
'This site provides open data about natural resource management on federal lands and waters in the United States, including oil, gas, coal, and other extractive industries.',
googleAnalyticsId: GOOGLE_ANALYTICS_ID,
version: 'v6.2.1',
author: '',
dataRetrieval: {
name: 'Data Specialists',
email: '[email protected]'
},
officeName: 'Office of Natural Resources Revenue',
informationDataManagement: {
name: 'Information and Data Management',
street: '1849 C Street NW MS 5134',
city: 'Washington, D.C.',
zip: '20240',
email: '[email protected]'
},
},
plugins: [
'gatsby-transformer-react-docgen',
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'Natural Resources Revenue Data',
short_name: 'NRRD',
start_url: '/',
background_color: '#ffffff',
theme_color: '#663399',
// Enables "Add to Homescreen" prompt and disables browser UI (including back button)
// see https://developers.google.com/web/fundamentals/web-app-manifest/#display
display: 'minimal-ui',
icon: 'src/images/icons/favicon.png', // This path is relative to the root of the site.
// An optional attribute which provides support for CORS check.
// If you do not provide a crossOrigin option, it will skip CORS for manifest.
// Any invalid keyword or empty string defaults to `anonymous`
crossOrigin: 'use-credentials',
},
},
{
resolve: 'gatsby-plugin-layout',
options: {
component: `${ __dirname }/src/components/layouts/PageLayoutManager`
}
},
{
resolve: 'gatsby-plugin-material-ui',
options: {
// stylesProvider: {
// injectFirst: true,
// }
}
},
'gatsby-theme-apollo',
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-plugin-mdx',
options: {
gatsbyRemarkPlugins: [
{
resolve: 'gatsby-remark-autolink-headers',
options: {
icon: false,
maintainCase: true,
removeAccents: true,
enableCustomId: true,
},
},
],
extensions: ['.mdx', '.md']
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${ __dirname }/src/pages`,
name: 'pages'
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${ __dirname }/src/images`
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'components',
path: `${ __dirname }/src/components`
}
},
'gatsby-transformer-sharp',
{
resolve: 'gatsby-plugin-sharp',
options: {
useMozJpeg: false,
stripMetadata: true,
defaultQuality: 75,
},
},
{
resolve: 'gatsby-source-graphql',
options: {
typeName: 'hasura',
fieldName: 'onrr',
createLink: () => {
return createHttpLink({
uri: 'https://hasura-onrr.app.cloud.gov/v1/graphql',
// uri: 'https://hasura-sandbox.app.cloud.gov/v1/graphql',
uri: 'https://hasura-nrrd-a.app.cloud.gov/v1/graphql',
// uri: 'https://hasura-nrrd-b.app.cloud.gov/v1/graphql',
headers: {},
fetch,
resolvers: {}
})
}
}
},
{
resolve: '@gatsby-contrib/gatsby-plugin-elasticlunr-search',
options: {
// Fields to index
fields: ['title', 'description', 'tags'],
// 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: {
title: node => node.frontmatter.title,
tags: node => node.frontmatter.tag || node.frontmatter.tags,
description: node => node.frontmatter.description,
path: node => node.fields.slug
}
},
// Optional filter to limit indexed nodes
filter: (node, getNode) => node.frontmatter.title !== ''
}
},
{
resolve: 'gatsby-plugin-anchor-links',
options: {
offset: -100
}
},
{
resolve: 'gatsby-plugin-offline',
options: {
workboxConfig: {
maximumFileSizeToCacheInBytes: 20000000
},
},
},
{
resolve: 'gatsby-plugin-google-tagmanager',
options: {
id: GTM_ID,
// Include GTM in development.
// Defaults to false meaning GTM will only be loaded in production.
includeInDevelopment: false,
// datalayer to be set before GTM is loaded
// should be an object or a function that is executed in the browser
//
// Defaults to null
defaultDataLayer: { platform: 'nrrd_data_layer' },
// Specify optional GTM environment details.
// gtmAuth: 'YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_AUTH_STRING',
gtmPreview: 'NRRD_CLOUD_GOV_PREVIEW_BRANCH',
// dataLayerName: 'YOUR_DATA_LAYER_NAME',
// Name of the event that is triggered
// on every Gatsby route change.
//
// Defaults to gatsby-route-change
// routeChangeEventName: 'YOUR_ROUTE_CHANGE_EVENT_NAME',
}
},
{
resolve: 'gatsby-plugin-remove-console',
options: {
exclude: ['error', 'warn'], // <- will remove all console calls except these
}
},
'gatsby-plugin-use-query-params',
'gatsby-plugin-meta-redirect' // make sure to put last in the array
]
}
module.exports = config