-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
214 lines (207 loc) · 6.62 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
require("dotenv").config({
path: `.env`,
})
const _ = require('lodash')
// ignore self signed cert error for connecting to wordpress
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
module.exports = {
siteMetadata: {
title: `Two Travelling Aussies`,
description: `Two travelling aussies on an adventure around the world`,
author: `Jordan Huizenga`,
siteUrl: `https://twotravellingaussies.com/`,
googleSiteVerification: 'EjT6ZOk_sCjeAn32Y4f8WeuhnU1t6DTkDMrWlUvEdWc'
},
plugins: [
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Two Travelling Aussies`,
short_name: `tta`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/favicon.jpeg`, // This path is relative to the root of the site.
},
},
`gatsby-plugin-postcss`,
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography`,
},
},
{
resolve: `gatsby-source-instagram`,
options: {
username: `twotravellingaussies`,
},
},
{
resolve: `gatsby-source-wordpress`,
options: {
/*
* The base URL of the WordPress site without the trailingslash and the protocol. This is required.
* Example : 'demo.wp-api.org' or 'www.example-site.com'
*/
baseUrl: `travelblog.jhuizy.com`,
verbose: true,
// The protocol. This can be http or https.
protocol: `https`,
// Indicates whether the site is hosted on wordpress.com.
// If false, then the assumption is made that the site is self hosted.
// If true, then the plugin will source its content on wordpress.com using the JSON REST API V2.
// If your site is hosted on wordpress.org, then set this to false.
hostingWPCOM: false,
// If useACF is true, then the source plugin will try to import the WordPress ACF Plugin contents.
// This feature is untested for sites hosted on WordPress.com
useACF: false,
jwt_user: process.env.JWT_USER,
jwt_pass: process.env.JWT_PASSWORD,
plugins: [
{
resolve: `gatsby-wordpress-inline-images`,
options: {
baseUrl: `twotravellingaussies.wordpress.com`,
protocol: `https`,
maxWidth: 590,
}
}
]
},
},
`gatsby-plugin-netlify-cms`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `netlify`,
path: `${__dirname}/content/blog`,
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: 'gatsby-remark-relative-images',
},
{
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: 590,
},
},
],
},
},
{
resolve: `gatsby-plugin-gtag`,
options: {
// your google analytics tracking id
trackingId: `UA-156928303-1`,
// Puts tracking script in the head instead of the body
head: false,
// enable ip anonymization
anonymize: true,
},
},
{
resolve: 'gatsby-plugin-mailchimp',
options: {
endpoint: 'https://gmail.us4.list-manage.com/subscribe/post?u=ceb80d2c22f485da453453c1c&id=0ec6199809',
},
},
{
resolve: `gatsby-plugin-feed`,
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
site_url: siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allMarkdownRemark, allWordpressPost } }) => {
const markdownPosts = allMarkdownRemark.edges.map(edge => {
return Object.assign({}, edge.node.frontmatter, {
url: site.siteMetadata.siteUrl + "/" + edge.node.frontmatter.title.replace(/ /g, '-').toLowerCase(),
guid: site.siteMetadata.siteUrl + "/" + edge.node.frontmatter.title.replace(/ /g, '-').toLowerCase(),
custom_elements: [{ "content:encoded": edge.node.html }],
})
})
const wordpressPosts = allWordpressPost.edges.map(edge => {
return {
title: edge.node.title,
date: edge.node.date,
description: edge.node.excerpt,
url: site.siteMetadata.siteUrl + "/" + edge.node.slug,
guid: site.siteMetadata.siteUrl + "/" + edge.node.slug,
custom_elements: [{ "content:encoded": edge.node.content }]
}
})
return _.sortBy([...markdownPosts, ...wordpressPosts], post => new Date(post.date)).reverse()
},
query: `
{
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] },
) {
edges {
node {
html
frontmatter {
title
date
description
}
}
}
},
allWordpressPost(sort: {fields: date, order: DESC}) {
edges {
node {
date(formatString: "DD MMMM YYYY")
excerpt
slug
title
content
}
}
}
}
`,
output: "/rss.xml",
},
],
},
},
`gatsby-plugin-advanced-sitemap`,
`gatsby-plugin-robots-txt`,
`gatsby-plugin-netlify`,
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
}