-
Notifications
You must be signed in to change notification settings - Fork 6
/
gatsby-config.js
190 lines (186 loc) · 5.87 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
const fetch = require('isomorphic-fetch')
const { createHttpLink } = require('apollo-link-http')
const activeEnv = (process.env.CIRCLE_BRANCH === 'master') ? 'prd' : 'dev'
require('dotenv').config({
path: `.env.${ activeEnv }`
})
const GTM_ID = process.env.NRRD_GTM_ID
// eslint-disable-next-line max-len
const PATH_PREFIX = (process.env.CIRCLE_STAGE === 'nrrd-preview') ? `/sites/${ process.env.CIRCLE_BRANCH }` : undefined
const config = {
pathPrefix: PATH_PREFIX,
siteMetadata: {
isShutdown: process.env.isShutdown,
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.',
keywords: 'Oil and gas, Coal, Renewable energy, Nonenergy minerals, Natural resource policy, Natural resource data, Extractives industries, Federal revenues, Production, 8(g) offshore revenue, offshore production, abanonded mine lands fund, mining reclamation tax, onrr state disbursement data, Native American land ownership, coal extraction, Department of the Interior, DOI, BLM coal leases, gomesa, gomesa funding, energy resource revenue, ONRR, state royalty, us eiti, solar industry, geothermal',
version: 'v7.10.1',
author: '',
dataRetrieval: {
name: 'Data Specialists',
email: '[email protected]'
},
officeName: 'Office of Natural Resources Revenue',
informationDataManagement: {
name: 'Information and Data Management',
street: 'PO Box 25165',
city: 'Denver, CO',
zip: '80225-0165',
email: '[email protected]',
contact: '[email protected]',
},
siteUrl: 'https://revenuedata.doi.gov',
},
plugins: [
'gatsby-transformer-react-docgen',
{
resolve: 'gatsby-plugin-google-tagmanager',
options: {
id: GTM_ID
}
},
{
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: {
name: 'images',
path: `${ __dirname }/src/images`
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${ __dirname }/src/pages`,
name: 'pages'
}
},
{
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: 'ONRR',
fieldName: 'onrr',
createLink: () => {
return createHttpLink({
uri: process.env.GATSBY_HASURA_URI,
headers: {},
fetch,
resolvers: {}
})
}
}
},
{
resolve: '@gatsby-contrib/gatsby-plugin-elasticlunr-search',
options: {
// Fields to index
fields: ['title', 'description', 'tags', 'glossary'],
// 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,
glossary: node => node.frontmatter.glossary
}
},
// 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: {
importWorkboxFrom: 'cdn',
maximumFileSizeToCacheInBytes: 20000000,
},
},
},
{
resolve: 'gatsby-plugin-remove-console',
options: {
exclude: ['error', 'warn'], // <- will remove all console calls except these
}
},
'gatsby-plugin-sitemap',
'gatsby-plugin-use-query-params',
'gatsby-plugin-meta-redirect' // make sure to put last in the array
]
}
module.exports = config