-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
128 lines (121 loc) · 3.36 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
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.org/docs/gatsby-config/
*/
require('dotenv').config({
path: `.env`
});
const BlogQuery = `
query {
allContentfulBlogPost (
sort: {
fields:publishedDate,
order:DESC
}
){
edges {
node {
title
slug
publishedDate(formatString:"MMM Do, YYYY")
}
}
}
}
`
const queries = [
{
query: BlogQuery,
transformer: ({ data }) => data.allContentfulBlogPost.edges.node
}
];
const path = require('path')
module.exports = {
siteMetadata: {
title: 'Stories of New Canadians',
author: 'Keshavaa Shaiskandan'
},
plugins: [
{
resolve: 'gatsby-plugin-algolia',
options: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME, // for all queries
queries,
chunkSize: 10000, // default: 1000
}
},
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-source-contentful',
options: {
spaceId: process.env.GATSBY_CONTENTFUL_SPACE_ID,
accessToken: process.env.GATSBY_CONTENTFUL_ACCESS_TOKEN
}
},
'gatsby-plugin-sass',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'src',
path: `${__dirname}/src/`
}
},
'gatsby-transformer-remark',
{
resolve: 'gatsby-plugin-mailchimp',
options: {
endpoint: "https://gmail.us4.list-manage.com/subscribe/post?u=030ab60dbad39723445796fc2&id=5f68f3a93f"
}
},
`gatsby-transformer-csv`,
{
resolve: 'gatsby-plugin-alias-imports',
options: {
alias: {
'@components': path.resolve(__dirname, './src/components/exports'),
'@templateStyles': path.resolve(__dirname, './src/styles/templateStyles'),
'@pageStyles': path.resolve(__dirname, './src/styles/pageStyles'),
'@compStyles': path.resolve(__dirname, './src/styles/componentStyles'),
'@images': path.resolve(__dirname, './src/images')
}
}
},
`gatsby-transformer-json`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: `./src/data/`,
},
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
// The property ID; the tracking code won't be generated without it
trackingId: "UA-156343051-1",
// Defines where to place the tracking script - `true` in the head and `false` in the body
head: false,
// Setting this parameter is optional
anonymize: true,
// Setting this parameter is also optional
respectDNT: true,
// Avoids sending pageview hits from custom paths
exclude: ["/preview/**", "/do-not-track/me/too/"],
// Delays sending pageview hits on route update (in milliseconds)
pageTransitionDelay: 0,
// Enables Google Optimize using your container Id
optimizeId: "YOUR_GOOGLE_OPTIMIZE_TRACKING_ID",
// Enables Google Optimize Experiment ID
experimentId: "YOUR_GOOGLE_EXPERIMENT_ID",
// Set Variation ID. 0 for original 1,2,3....
variationId: "YOUR_GOOGLE_OPTIMIZE_VARIATION_ID",
// Any additional optional fields
sampleRate: 5,
siteSpeedSampleRate: 10,
cookieDomain: "example.com",
}
}
]
}