forked from ethereum/esp-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
152 lines (150 loc) · 4.23 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
const translations = require("./src/utils/translations")
const supportedLanguages = translations.supportedLanguages
const defaultLanguage = `en`
const siteUrl = `https://esp.ethereum.foundation`
module.exports = {
siteMetadata: {
// `title` & `description` pulls from respective ${lang}.json files in PageMetadata.js
title: `Ethereum Ecosystem Support Program`,
description: `The Ethereum Ecosystem Support Program provides financial and non-financial support for projects working to accelerate the growth of Ethereum.`,
url: siteUrl,
siteUrl, // for sitemap generation
author: `@EF_ESP`,
defaultLanguage,
supportedLanguages,
},
plugins: [
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-react-helmet-canonical-urls`,
options: {
siteUrl,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/pages`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/images`,
},
},
// Markdown header anchor links
`gatsby-remark-autolink-headers`,
// Image support in markdown
`gatsby-remark-images`,
// MDX support
{
resolve: `gatsby-plugin-mdx`,
options: {
// process all `.md` files as MDX
extensions: [`.mdx`, `.md`],
// Note: in order for MDX to work with gatsby-remark-plugins
// The plugin must be listed top-level & in gatsbyRemarkPlugins
// See: https://www.gatsbyjs.org/docs/mdx/plugins/
gatsbyRemarkPlugins: [
{
resolve: `gatsby-remark-autolink-headers`,
options: {
enableCustomId: true,
elements: [`h1`, `h2`, `h3`, `h4`],
className: `header-anchor`,
},
},
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 1200,
},
},
],
remarkPlugins: [],
},
},
// Need for `gatsby-image`
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/favicons/114.png`, // This path is relative to the root of the site.
},
},
{
resolve: `gatsby-plugin-google-fonts`,
options: {
fonts: [`Work Sans\:100,300,400,500,600,700`],
},
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "UA-145235410-1",
},
},
{
resolve: `gatsby-plugin-sitemap`,
options: {
exclude: [`/en/grantee-finance-form/`],
query: `{
site {
siteMetadata {
siteUrl
}
}
allSitePage {
nodes {
path
}
}
}`,
serialize: ({ site, allSitePage }) =>
allSitePage.nodes
.filter(node => {
const path = node.path
// Filter out 404 pages
if (path.includes("404")) {
return false
}
// Filter out base pages that don't have a language directory
return supportedLanguages.includes(path.split("/")[1])
})
.map(node => {
return {
url: `${site.siteMetadata.siteUrl}${node.path}`,
changefreq: `weekly`,
priority: 0.7,
}
}),
},
},
// i18n support
{
resolve: `gatsby-plugin-intl`,
options: {
// language JSON resource path
path: `${__dirname}/src/intl`,
// supported language
languages: supportedLanguages,
// language file path
defaultLanguage,
// redirect to `/en/` when connecting `/`
redirect: false,
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
}