forked from newrelic/opensource-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
174 lines (169 loc) · 6.64 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
const path = require(`path`);
const _ = require('lodash');
const remarkExternalLinks = require('./plugins/remark-external-link-icon');
module.exports = {
siteMetadata: {
title: `New Relic Open Source`,
description: `New Relic's open source website makes it easy for you to explore the projects we're maintaining as well as our involvement in open standards.`,
author: `@newrelic`,
repository: 'https://github.com/newrelic/opensource-website',
siteUrl: 'https://opensource.newrelic.com',
},
plugins: [
{
resolve: '@newrelic/gatsby-theme-newrelic',
options: {
layout: {
// 1180px (width) + 28px (padding) * 2 (left/right side)
maxWidth: '1236px',
contentPadding: '28px',
},
newrelic: {
// Keyed by process.env.NODE_ENV
configs: {
/*
;NREUM.loader_config={accountID:"10175106",trustKey:"1",agentID:"21547964",licenseKey:"23448da482",applicationID:"21547964"}
;NREUM.info={beacon:"staging-bam.nr-data.net",errorBeacon:"staging-bam.nr-data.net",licenseKey:"23448da482",applicationID:"21547964",sa:1}
*/
production: {
instrumentationType: 'proAndSPA', // Options are 'lite', 'pro', 'proAndSPA'
accountId: '10175106',
trustKey: '1',
agentID: '21547964',
licenseKey: '23448da482',
applicationID: '21547964',
beacon: 'staging-bam.nr-data.net',
errorBeacon: 'staging-bam.nr-data.net',
},
// Our "staging" site (on AWS Amplify) named after the branch it comes from "develop"
/*
;NREUM.loader_config={accountID:"10175106",trustKey:"1",agentID:"21548202",licenseKey:"23448da482",applicationID:"21548202"}
;NREUM.info={beacon:"staging-bam.nr-data.net",errorBeacon:"staging-bam.nr-data.net",licenseKey:"23448da482",applicationID:"21548202",sa:1}
*/
staging: {
instrumentationType: 'proAndSPA', // Options are 'lite', 'pro', 'proAndSPA'
accountId: '10175106',
trustKey: '1',
agentID: '21548202',
licenseKey: '23448da482',
applicationID: '21548202',
beacon: 'staging-bam.nr-data.net',
errorBeacon: 'staging-bam.nr-data.net',
},
// For local development, uncomment and replace information
// development: {
// instrumentationType: 'proAndSPA', // Options are 'lite', 'pro', 'proAndSPA'
// accountId: '',
// trustKey: '',
// agentID: '',
// licenseKey: '',
// applicationID: ''
// }
},
},
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `data`,
path: `${__dirname}/src/data`,
ignore: [`**/\.*`], // ignore files starting with a dot
},
},
{
resolve: `gatsby-transformer-json`,
options: {
// Override the default behavior that adds `Json` to the end of data types
// Found here - https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-transformer-json/src/gatsby-node.js#L8-L20
typeName: ({ node, object, isArray }) => {
// eslint-disable-next-line no-unused-vars
const getType = function ({ node, object, isArray }) {
if (node.internal.type !== `File`) {
return _.upperFirst(_.camelCase(`${node.internal.type}`));
} else if (isArray) {
return _.upperFirst(_.camelCase(`${node.name}`));
} else {
return _.upperFirst(_.camelCase(`${path.basename(node.dir)}`));
}
};
const typeName = getType({ node, object, isArray });
return typeName;
},
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `New Relic Open source`,
short_name: `NR OSS`,
start_url: `/`,
background_color: `#007e8a`,
theme_color: `#007e8a`,
display: `minimal-ui`,
icon: `src/images/icon.png`, // This path is relative to the root of the site.
},
},
'gatsby-plugin-sass',
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
{
resolve: `gatsby-plugin-mdx`,
options: {
remarkPlugins: [remarkExternalLinks],
// https://www.gatsbyjs.org/packages/gatsby-plugin-mdx/#remark-plugins
gatsbyRemarkPlugins: [
{
resolve: `gatsby-remark-copy-linked-files`,
options: {
// `ignoreFileExtensions` defaults to [`png`, `jpg`, `jpeg`, `bmp`, `tiff`]
// as we assume you'll use gatsby-remark-images to handle
// images in markdown as it automatically creates responsive
// versions of images.
//
// If you'd like to not use gatsby-remark-images and just copy your
// original images to the public directory, set
// `ignoreFileExtensions` to an empty array.
// ignoreFileExtensions: []
ignoreFileExtensions: [`png`, `jpg`, `jpeg`, `bmp`, `tiff`],
},
},
{
resolve: `gatsby-remark-images`,
options: {
// It's important to specify the maxWidth (in pixels) of
// the content container as this plugin uses this as the
// base for generating different widths of each image.
maxWidth: 590,
},
},
],
// remarkPlugins: [require(`gatsby-remark-copy-linked-files`)],
extensions: [`.mdx`, `.md`],
},
},
{
resolve: 'gatsby-plugin-edit-content-links',
},
{
resolve: 'gatsby-plugin-gdpr-tracking',
options: {
// logging to the console, if debug is true
debug: false,
googleAnalytics: {
// The property ID; the tracking code won't be generated without it.
trackingId: 'UA-3047412-33',
// Defines it google analytics should be started with out the cookie consent
autoStart: false, // <--- default
// Setting this parameter is optional
anonymize: true, // <--- default
// Name of the cookie, that enables the tracking if it is true
controlCookieName: 'newrelic-gdpr-consent', // <--- default
cookieFlags: 'secure;samesite=none', // <--- default
},
environments: ['production', 'development'],
},
},
],
};