-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathgatsby-config.js
150 lines (146 loc) · 3.54 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
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
})
const dynamicPlugins = []
if (process.env.MAILCHIMP_KEY) {
dynamicPlugins.push({
resolve: 'gatsby-source-mailchimp',
options: {
campaignFields: [
'campaigns.archive_url',
'campaigns.settings.title',
'campaigns.settings.subject_line',
'campaigns.settings.preview_text',
'campaigns.send_time',
'campaigns.emails_sent',
],
contentFields: ['archive_html'],
nodeType: 'Newsletters',
key: process.env.MAILCHIMP_KEY,
rootURL: 'https://us7.api.mailchimp.com/3.0',
},
})
}
module.exports = {
siteMetadata: {
title: 'Liferay.Design',
author: 'Paul Hanaoka',
description:
'Blogs, careers, guidelines, and other resources from the Design Teams at Liferay!',
},
plugins: [
{
resolve: `gatsby-plugin-algolia-docsearch`,
options: {
apiKey: 'e743f8519124b276f2f3325e8e126246',
indexName: 'liferay_design',
inputSelector: '#lexicon_search',
debug: false,
},
},
'gatsby-plugin-brotli',
'gatsby-plugin-catch-links',
`gatsby-plugin-netlify-cms`,
'gatsby-plugin-react-helmet',
'gatsby-plugin-resolve-src',
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Liferay Design`,
short_name: `Liferay.Design`,
background_color: `#FFF`,
theme_color: `#0b5fff`,
icon: `src/images/favicon.svg`,
},
},
'gatsby-plugin-offline',
'gatsby-plugin-sass',
'gatsby-plugin-sharp',
`gatsby-plugin-theme-ui`,
`gatsby-transformer-json`,
'gatsby-transformer-sharp',
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography`,
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'src',
path: './src',
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/images`,
name: 'images',
},
},
`gatsby-transformer-yaml`,
{
resolve: 'gatsby-plugin-mdx',
options: {
extensions: ['.mdx', '.md'],
gatsbyRemarkPlugins: [
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 768,
withWebp: true,
quality: 96,
backgroundColor: 'transparent',
disableBgImageOnAlpha: true,
wrapperStyle: 'margin-bottom: 2em; margin-top: 1em;',
},
},
{
resolve: `gatsby-remark-image-attributes`,
options: {
dataAttributes: true,
},
},
{
resolve: 'gatsby-remark-static-images',
},
{
resolve: 'gatsby-remark-autolink-headers',
options: {
offsetY: `200`,
className: `nice-anchor`,
},
},
{
resolve: 'gatsby-remark-external-links',
},
{
resolve: `gatsby-plugin-catch-links`,
},
],
},
},
{
resolve: `gatsby-plugin-typescript`,
// options: { // commenting these out until I figure out what's best
// isTSX: true, // defaults to false
// jsxPragma: `jsx`, // defaults to "React"
// allExtensions: true, // defaults to false
// },
},
].concat(dynamicPlugins),
mapping: {
'MarkdownRemark.frontmatter.author': `AuthorsYaml`,
'Mdx.frontmatter.author': `AuthorsYaml`,
'AuthorsYaml.office': `OfficesYaml.id`,
'CountriesYaml.hq': `OfficesYaml.id`,
'OfficesYaml.region': `CountriesYaml.id`,
'MarkdownRemark.frontmatter.office': `OfficesYaml`,
'Mdx.frontmatter.office': `OfficesYaml`,
'ChangelogYaml.author': `AuthorsYaml.id`,
'AnnualReportsYaml.promotionsPage.designers.name': `AuthorsYaml`,
'ChangelogYaml.contributors': `AuthorsYaml.id`,
'Mdx.frontmatter.contributors': `AuthorsYaml.id`,
},
}