This repository was archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
182 lines (173 loc) · 6.06 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.org/docs/gatsby-config/
*/
module.exports = {
siteMetadata: {
shortName: `tinynewsco`,
title: `the tiny news collective`,
siteUrl: `https://tinynewsco.org/`,
description: `a local news initiative`,
subscribe: {
title: `Subscribe`,
subtitle: `Get the latest news about the tiny news collective in your inbox.`,
},
footerTitle: `tinynewsco.org`,
footerBylineName: `News Catalyst`,
footerBylineLink: `https://newscatalyst.org`,
labels: {
latestNews: `Latest News`,
search: `Search`,
topics: `Topics`,
},
nav: {
articles: `Articles`,
topics: `All Topics`,
cms: `tinycms`
}
},
/* Your site config here */
plugins:
[
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
// It's important to specify the maxWidth (in pixels) of
// the content container as this plugin uses this as the
// base for generating different widths of each image.
maxWidth: 1290,
wrapperStyle: "margin-top: 10px; margin-bottom: 10px;"
},
},
],
},
},
{
resolve: "gatsby-source-google-docs",
options: {
folders: ["1lcfhd58_0D6-uP0Dwb0a_-Yri2L0h-6K"],
debug: true,
}
},
`gatsby-plugin-sharp`,
`gatsby-plugin-sass`,
{
resolve: 'gatsby-plugin-next-seo',
options: {
canonical: 'https://tinynewsco.org/',
titleTemplate: 'tiny news co | %s',
openGraph: {
type: 'website',
locale: 'en_US',
url: 'https://tinynewsco.org/',
site_name: 'tiny news co',
},
twitter: {
handle: '@tinynewsco',
site: '@newscatalyst',
cardType: 'summary_large_image',
},
},
},
{
resolve: 'gatsby-plugin-mailchimp',
options: {
endpoint: 'https://tinynewsco.us18.list-manage.com/subscribe/post?u=a91c8e3b29e153f11e34be272&id=417b45b221', // add your MC list endpoint here; see instructions below
},
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
// The property ID; the tracking code won't be generated without it
trackingId: "UA-166777432-1",
// Defines where to place the tracking script - `true` in the head and `false` in the body
head: true,
// 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",
// Defers execution of google analytics script after page load
defer: false,
// Any additional optional fields
// sampleRate: 5,
// siteSpeedSampleRate: 10,
// cookieDomain: "example.com",
},
},
// You can have multiple instances of this plugin to create indexes with
// different names or engines. For example, multi-lingual sites could create
// an index for each language.
{
resolve: 'gatsby-plugin-local-search',
options: {
// A unique name for the search index. This should be descriptive of
// what the index contains. This is required.
name: 'articles',
// Set the search engine to create the index. This is required.
// The following engines are supported: flexsearch, lunr
engine: 'flexsearch',
// Provide options to the engine. This is optional and only recommended
// for advanced users.
//
// Note: Only the flexsearch engine supports options.
engineOptions: 'speed',
// GraphQL query used to fetch all data for the search index. This is
// required.
query: `
{
allGoogleDocs(filter: {document: {breadcrumb: {nin: "Drafts"}}}) {
nodes {
id
document {
author
name
path
}
childMarkdownRemark {
html
}
}
}
}
`,
// Field used as the reference value for each document.
// Default: 'id'.
ref: 'id',
// List of keys to index. The values of the keys are taken from the
// normalizer function below.
// Default: all fields
index: ['name', 'body'],
// List of keys to store and make available in your UI. The values of
// the keys are taken from the normalizer function below.
// Default: all fields
store: ['id', 'path', 'name'],
// Function used to map the result from the GraphQL query. This should
// return an array of items to index in the form of flat objects
// containing properties to index. The objects must contain the `ref`
// field above (default: 'id'). This is required.
normalizer: ({ data }) =>
data.allGoogleDocs.nodes.map(node => ({
id: node.id,
path: node.document.path,
name: node.document.name,
body: node.childMarkdownRemark.html,
})),
},
},
]
}