forked from Mergifyio/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.mjs
138 lines (131 loc) · 3.13 KB
/
gatsby-config.mjs
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
import dotenv from 'dotenv'
dotenv.config({
path: `.env.${process.env.NODE_ENV}`,
});
dotenv.populate(
process.env,
{
GATSBY_ALGOLIA_APP_ID: "81GKA2I1R0",
GATSBY_ALGOLIA_SEARCH_KEY: "6fce1b6d8ccf82a6601a169c0167c0e3"
},
{ override: true }
)
const gatsbyRemarkPlugins = [
'@fec/remark-a11y-emoji/gatsby',
'gatsby-remark-embed-video',
{
resolve: 'gatsby-remark-copy-linked-files',
options: {
destinationDir: f => `${f.name}`
}
},
{
resolve: 'gatsby-remark-autolink-headers',
options: {
icon: false
}
},
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 1200,
},
},
'gatsby-remark-graphviz',
];
const plugins = [
'gatsby-plugin-react-helmet',
'gatsby-plugin-svgr',
'@chakra-ui/gatsby-plugin',
'gatsby-plugin-sitemap',
{
resolve: 'gatsby-plugin-manifest',
options: {
icon: 'src/assets/favicon.svg'
}
},
{
resolve: `gatsby-plugin-plausible`,
options: {
domain: `docs.mergify.com`,
},
},
'gatsby-plugin-offline',
{
resolve: 'gatsby-plugin-webfonts',
options: {
fonts: {
google: [
{
family: 'Source Sans Pro',
variants: ['400', '600', '700']
},
{
family: 'Source Code Pro',
variants: ['400', '600']
},
{
family: 'Poppins',
variants: ['300', '400', '600']
}
]
}
}
},
{
resolve: 'gatsby-plugin-mdx',
options: {
extensions: ['.mdx', '.md'],
gatsbyRemarkPlugins,
},
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: gatsbyRemarkPlugins
}
},
'gatsby-plugin-local-docs', // local plugin
{
resolve: 'gatsby-source-filesystem',
options: {
name: '/',
path: 'src/content'
}
},
{
resolve: `gatsby-plugin-netlify`,
options: {
headers: {
"/*": [
"Cache-control: public, max-age=600, no-transform",
"Content-Security-Policy: default-src 'self' https:; " +
"frame-ancestors 'none'; " +
"script-src 'self' https: 'unsafe-inline'; " +
"style-src 'self' 'unsafe-inline' https:; " +
"img-src 'self' data: https:; " +
"manifest-src 'self' data:",
]
},
allPageHeaders: [],
mergeSecurityHeaders: true,
mergeCachingHeaders: true,
transformHeaders: (headers, path) => headers,
generateMatchPathRewrites: true,
},
},
];
/** Custom plugin to push records on algolia */
Boolean(process.env.ALGOLIA_WRITE_KEY) && plugins.push('algolia-plugin')
const config = {
pathPrefix: '/' + process.env.PR_NUMBER + '/docs',
trailingSlash: 'always',
siteMetadata: {
title: 'Mergify Documentation',
description: 'Learn how to use Mergify, the powerful pull request automation tool that helps teams merge code faster and more safely. Automate your entire pull request workflow, from code review to deployment, and save time and frustration.',
siteUrl: 'https://docs.mergify.com',
image: '/favicon.svg'
},
plugins
};
export default config;