forked from prisma/web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgatsby-config.js
More file actions
132 lines (127 loc) · 3.39 KB
/
gatsby-config.js
File metadata and controls
132 lines (127 loc) · 3.39 KB
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
const config = require('./config')
require('dotenv').config()
const gatsbyRemarkPlugins = [
'gatsby-remark-sectionize',
{
resolve: `gatsby-remark-autolink-headers`,
options: {
icon: `<svg width="17" height="18" viewBox="0 0 17 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.5 6.33337H15.5" stroke="#CBD5E0" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M1.5 11.6666H15.5" stroke="#CBD5E0" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M6.75 1L5 17" stroke="#CBD5E0" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M12 1L10.25 17" stroke="#CBD5E0" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
</svg>`,
className: `title-link`,
enableCustomId: true,
},
},
{
resolve: `gatsby-remark-images`,
options: {
disableBgImageOnAlpha: true,
},
},
{
resolve: require.resolve('./plugins/gatsby-remark-to-absoluteurl'),
options: {
redirects: config.redirects,
},
},
{
resolve: require.resolve('./plugins/gatsby-remark-check-links-numberless'),
},
{
resolve: 'gatsby-remark-copy-linked-files',
options: {
destinationDir: 'static',
},
},
]
const algoliaPlugin = {
resolve: `gatsby-plugin-algolia`,
options: require(`./src/utils/algolia`),
}
let plugins = [
'gatsby-plugin-react-helmet',
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
'gatsby-plugin-typescript',
'gatsby-image',
'gatsby-plugin-styled-components',
'gatsby-plugin-smoothscroll',
'gatsby-plugin-catch-links',
// {
// resolve: `gatsby-plugin-layout`,
// options: {
// component: require.resolve(`./src/layouts/articleLayout.tsx`),
// },
// },
{
resolve: `gatsby-plugin-sitemap`,
options: {
sitemapSize: 5000,
},
},
{
resolve: 'gatsby-plugin-robots-txt',
options: {
policy: [
{
userAgent: '*',
disallow: '/',
},
],
},
},
// 'gatsby-plugin-offline', // it causes infinite loop issue with workbox
{
resolve: `gatsby-plugin-mdx`,
options: {
decks: [],
defaultLayouts: {
default: require.resolve('./src/layouts/articleLayout.tsx'),
},
extensions: ['.mdx', '.md'],
gatsbyRemarkPlugins,
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'docs',
path: `${__dirname}/content`,
ignore: ['**/.tsx*'],
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/images`,
},
},
'gatsby-plugin-remove-trailing-slashes',
'gatsby-plugin-meta-redirect'
]
if (process.env.INDEX_ALGOLIA === 'true') {
plugins = [...plugins, algoliaPlugin]
}
module.exports = {
pathPrefix: process.env.ADD_PREFIX === 'true' ? config.gatsby.pathPrefix : '/',
siteMetadata: {
pathPrefix: config.gatsby.pathPrefix,
title: config.siteMetadata.title,
titlePrefix: config.gatsby.titlePrefix,
titleSuffix: config.gatsby.titleSuffix,
description: config.siteMetadata.description,
keywords: config.siteMetadata.keywords,
twitter: config.siteMetadata.twitter,
og: config.siteMetadata.og,
header: config.header,
siteUrl: config.gatsby.siteUrl,
footer: config.footer,
docsLocation: config.siteMetadata.docsLocation,
redirects: config.redirects
},
plugins,
}